| Modifier and Type | Field and Description |
|---|---|
| public short[] | |
| public boolean | |
| public int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | ShortArray(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 | ShortArray(short[] array)
Creates a new ordered array containing the elements in the specified array. |
| public | ShortArray(boolean
If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy. ordered, short[] 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 void | |
| public boolean | |
| public short[] | 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 short | |
| public short | |
| public int | |
| public void | |
| public void | |
| public int | |
| public void | |
| public void | |
| public boolean | |
| public int | |
| public void | |
| public void | |
| public boolean | |
| public short | |
| public short | |
| public short | |
| public boolean | Returns: true if this array was modified.Removes from this array the first instance of each element contained in the specified array. |
| public short | |
| public void | |
| public boolean | |
| public int | Returns: the number of replacements donethe short to be replaced value, short 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 short to be replaced value, short 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 short[] | |
| public void | |
| public void | |
| public short[] | |
| public short[] | |
| public void | |
| public void | |
| public void | |
| public short[] | |
| public String | |
| public String | |
| public void | |
| public static ShortArray |
| items | back to summary |
|---|---|
| public short[] items | |
| ordered | back to summary |
|---|---|
| public boolean ordered | |
| size | back to summary |
|---|---|
| public int size | |
| ShortArray | back to summary |
|---|---|
| public ShortArray() Creates an ordered array with a capacity of 16. | |
| ShortArray | back to summary |
|---|---|
| public ShortArray(int capacity) Creates an ordered array with the specified capacity. | |
| ShortArray | back to summary |
|---|---|
public ShortArray(boolean ordered, int capacity)
| |
| ShortArray | back to summary |
|---|---|
| public ShortArray(ShortArray 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. | |
| ShortArray | back to summary |
|---|---|
| public ShortArray(short[] 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. | |
| ShortArray | back to summary |
|---|---|
| public ShortArray(boolean ordered, short[] 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) Casts the specified value to short and adds it. | |
| add | back to summary |
|---|---|
| public void add(short value) | |
| add | back to summary |
|---|---|
| public void add(short value1, short value2) | |
| add | back to summary |
|---|---|
| public void add(short value1, short value2, short value3) | |
| add | back to summary |
|---|---|
| public void add(short value1, short value2, short value3, short value4) | |
| addAll | back to summary |
|---|---|
| public void addAll(ShortArray array) | |
| addAll | back to summary |
|---|---|
| public void addAll(ShortArray array, int offset, int length) | |
| addAll | back to summary |
|---|---|
| public void addAll(short... array) | |
| addAll | back to summary |
|---|---|
| public void addAll(short[] array, int offset, int length) | |
| clear | back to summary |
|---|---|
| public void clear() | |
| contains | back to summary |
|---|---|
| public boolean contains(short value) | |
| ensureCapacity | back to summary |
|---|---|
| public short[] 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 short first() Returns the first item. | |
| get | back to summary |
|---|---|
| public short 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, short value) | |
| incr | back to summary |
|---|---|
| public void incr(short value) | |
| indexOf | back to summary |
|---|---|
| public int indexOf(short value) | |
| insert | back to summary |
|---|---|
| public void insert(int index, short 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(short value) | |
| mul | back to summary |
|---|---|
| public void mul(int index, short value) | |
| mul | back to summary |
|---|---|
| public void mul(short value) | |
| notEmpty | back to summary |
|---|---|
| public boolean notEmpty() Returns true if the array has one or more items. | |
| peek | back to summary |
|---|---|
| public short peek() Returns the last item. | |
| pop | back to summary |
|---|---|
| public short pop() Removes and returns the last item. | |
| random | back to summary |
|---|---|
| public short random() Returns a random item from the array, or zero if the array is empty. | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(ShortArray array) Removes from this array the first instance of each element contained in the specified array.
| |
| removeIndex | back to summary |
|---|---|
| public short 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(short value) | |
| replaceAll | back to summary |
|---|---|
| public int replaceAll(short value, short replacement) Returns the number of replacements done.
| |
| replaceFirst | back to summary |
|---|---|
| public boolean replaceFirst(short value, short replacement) Returns true if the specified value was replaced successfully with the replacement
| |
| resize | back to summary |
|---|---|
| protected short[] resize(int newSize) | |
| reverse | back to summary |
|---|---|
| public void reverse() | |
| set | back to summary |
|---|---|
| public void set(int index, short value) | |
| setSize | back to summary |
|---|---|
| public short[] setSize(int newSize) Sets the array size, leaving any values beyond the current size undefined.
| |
| shrink | back to summary |
|---|---|
| public short[] 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 short[] 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 ShortArray with(short... array)
| |