public new bool Equals(object obj) { if (this == obj) { return(true); } if (!(obj is IntArray)) { return(false); } IntArray array = (IntArray)obj; int size = GetSize(); if (array.GetSize() != size) { return(false); } for (int i = 0; i < size; i++) { if (Get(i) != array.Get(i)) { return(false); } } return(true); }
public void Remove(IntArray indices) { int size = indices.GetSize(); for (int i = 0; i < size; i++) { Remove(indices.Get(i)); } }
public void Add(IntArray indices) { int size = indices.GetSize(); for (int i = 0; i < size; i++) { Add(indices.Get(i)); } }
/// <summary> /// Appends all the elements in the specified array at the /// end of this array. /// </summary> /// <param name="array"></param> public void Add(IntArray array) { int arraySize = array.GetSize(); EnsureCapacity(size + arraySize); for (int i = 0; i < arraySize; i++) { data[size++] = array.Get(i); } }
/// <summary> /// Constructs an IntSet using the specified array. /// <para> /// NOTE: The array should not have any negative elements. /// </para> /// </summary> /// <param name="array"></param> /// <returns></returns> public static IntSet CreateIntSet(IntArray array) { if (array is IntSet) { return((IntSet)array); } int size = array.GetSize(); BitSetIntSet bitset = new BitSetIntSet(size); for (int i = 0; i < size; i++) { bitset.Set(array.Get(i)); } return(bitset); }
public HelperIntIterator2(IntArray array) { this.array = array; size = array.GetSize(); index = 0; }