| Modifier and Type | Field and Description |
|---|---|
| public int[] | |
| public boolean | |
| public int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | IntArray(boolean
If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy. ordered, int Any elements added beyond this will cause the backing array to be grown. capacity)
|
| public | |
| public | |
| public | IntArray(boolean
If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy. ordered, int[] array, int startIndex, int count)Creates a new array containing the elements in the specified array. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public int[] | Returns: itemsIncreases the size of the backing array to accommodate the specified number of additional items. |
| public boolean | equals(Object object)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public int | |
| public int | |
| public void | |
| public void | |
| public int | |
| public void | |
| public void | |
| public boolean | |
| public int | |
| public void | |
| public void | |
| public boolean | |
| public int | |
| public int | |
| public int | |
| public boolean | |
| public int | |
| public void | |
| public boolean | |
| public int | Returns: the number of replacements donethe int to be replaced value, int all occurrences of value will be replaced by this replacement replacement)Returns the number of replacements done. |
| public boolean | Returns: if value was found and replacedthe int to be replaced value, int the first value will be replaced by this replacement if found replacement)Returns true if the specified value was replaced successfully with the replacement |
| protected int[] | |
| public void | |
| public void | |
| public int[] | |
| public int[] | |
| public void | |
| public void | |
| public void | |
| public int[] | |
| public String | |
| public String | |
| public void | |
| public static IntArray |
| items | back to summary |
|---|---|
| public int[] items | |
| ordered | back to summary |
|---|---|
| public boolean ordered | |
| size | back to summary |
|---|---|
| public int size | |
| IntArray | back to summary |
|---|---|
| public IntArray() Creates an ordered array with a capacity of 16. | |
| IntArray | back to summary |
|---|---|
| public IntArray(int capacity) Creates an ordered array with the specified capacity. | |
| IntArray | back to summary |
|---|---|
public IntArray(boolean ordered, int capacity)
| |
| IntArray | back to summary |
|---|---|
| public IntArray(IntArray array) Creates a new array containing the elements in the specific array. The new array will be ordered if the specific array is ordered. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be grown. | |
| IntArray | back to summary |
|---|---|
| public IntArray(int[] array) Creates a new ordered array containing the elements in the specified array. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be grown. | |
| IntArray | back to summary |
|---|---|
| public IntArray(boolean ordered, int[] array, int startIndex, int count) Creates a new array containing the elements in the specified array. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be grown.
| |
| add | back to summary |
|---|---|
| public void add(int value) | |
| add | back to summary |
|---|---|
| public void add(int value1, int value2) | |
| add | back to summary |
|---|---|
| public void add(int value1, int value2, int value3) | |
| add | back to summary |
|---|---|
| public void add(int value1, int value2, int value3, int value4) | |
| addAll | back to summary |
|---|---|
| public void addAll(IntArray array) | |
| addAll | back to summary |
|---|---|
| public void addAll(IntArray array, int offset, int length) | |
| addAll | back to summary |
|---|---|
| public void addAll(int... array) | |
| addAll | back to summary |
|---|---|
| public void addAll(int[] array, int offset, int length) | |
| clear | back to summary |
|---|---|
| public void clear() | |
| contains | back to summary |
|---|---|
| public boolean contains(int value) | |
| ensureCapacity | back to summary |
|---|---|
| public int[] ensureCapacity(int additionalCapacity) Increases the size of the backing array to accommodate the specified number of additional items. Useful before adding many items to avoid multiple backing array resizes.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| first | back to summary |
|---|---|
| public int first() Returns the first item. | |
| get | back to summary |
|---|---|
| public int get(int index) | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| incr | back to summary |
|---|---|
| public void incr(int index, int value) | |
| incr | back to summary |
|---|---|
| public void incr(int value) | |
| indexOf | back to summary |
|---|---|
| public int indexOf(int value) | |
| insert | back to summary |
|---|---|
| public void insert(int index, int value) | |
| insertRange | back to summary |
|---|---|
| public void insertRange(int index, int count) Inserts the specified number of items at the specified index. The new items will have values equal to the values at those indices before the insertion. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns true if the array is empty. | |
| lastIndexOf | back to summary |
|---|---|
| public int lastIndexOf(int value) | |
| mul | back to summary |
|---|---|
| public void mul(int index, int value) | |
| mul | back to summary |
|---|---|
| public void mul(int value) | |
| notEmpty | back to summary |
|---|---|
| public boolean notEmpty() Returns true if the array has one or more items. | |
| peek | back to summary |
|---|---|
| public int peek() Returns the last item. | |
| pop | back to summary |
|---|---|
| public int pop() Removes and returns the last item. | |
| random | back to summary |
|---|---|
| public int random() Returns a random item from the array, or zero if the array is empty. | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(IntArray array) Removes from this array the first instance of each element contained in the specified array.
| |
| removeIndex | back to summary |
|---|---|
| public int removeIndex(int index) Removes and returns the item at the specified index. | |
| removeRange | back to summary |
|---|---|
| public void removeRange(int start, int end) Removes the items between the specified indices, inclusive. | |
| removeValue | back to summary |
|---|---|
| public boolean removeValue(int value) | |
| replaceAll | back to summary |
|---|---|
| public int replaceAll(int value, int replacement) Returns the number of replacements done.
| |
| replaceFirst | back to summary |
|---|---|
| public boolean replaceFirst(int value, int replacement) Returns true if the specified value was replaced successfully with the replacement
| |
| resize | back to summary |
|---|---|
| protected int[] resize(int newSize) | |
| reverse | back to summary |
|---|---|
| public void reverse() | |
| set | back to summary |
|---|---|
| public void set(int index, int value) | |
| setSize | back to summary |
|---|---|
| public int[] setSize(int newSize) Sets the array size, leaving any values beyond the current size undefined.
| |
| shrink | back to summary |
|---|---|
| public int[] shrink() Reduces the size of the backing array to the size of the actual items. This is useful to release memory when many items have been removed, or if it is known that more items will not be added.
| |
| shuffle | back to summary |
|---|---|
| public void shuffle() | |
| sort | back to summary |
|---|---|
| public void sort() | |
| swap | back to summary |
|---|---|
| public void swap(int first, int second) | |
| toArray | back to summary |
|---|---|
| public int[] toArray() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| toString | back to summary |
|---|---|
| public String toString(String separator) | |
| truncate | back to summary |
|---|---|
| public void truncate(int newSize) Reduces the size of the array to the specified size. If the array is already smaller than the specified size, no action is taken. | |
| with | back to summary |
|---|---|
public static IntArray with(int... array)
| |