| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public T[] | items
Provides direct access to the underlying array. |
| private transient Array. | |
| public boolean | |
| private transient Predicate. | |
| public int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Array(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 | Array(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, ArraySupplier<T[]> arraySupplier)Creates a new array with |
| public | Array(ArraySupplier<T[]> arraySupplier)
Creates an ordered array with |
| public | Array(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, Class<T> arrayType)
Deprecated
Use
Array#Array(boolean, int, ArraySupplier) instead
Creates a new array with |
| public | Array(Class<T> arrayType)
Deprecated
Use
Array#Array(ArraySupplier) instead
Creates an ordered array with |
| public | |
| public | |
| public | Array(boolean
If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy. ordered, T[] array, int start, 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 | contains(T
May be null. value, boolean If true, == comparison will be used. If false, .equals() comparison will be used. identity)Returns true if this array contains the specified value. |
| public boolean | containsAll(Array<? extends T>
May contains nulls. values, boolean If true, == comparison will be used. If false, .equals() comparison will be used. identity)Returns true if this array contains all the specified values. |
| public boolean | containsAny(Array<? extends T>
May contains nulls. values, boolean If true, == comparison will be used. If false, .equals() comparison will be used. identity)Returns true if this array contains any the specified values. |
| public T[] | Returns: itemsIncreases the size of the backing array to accommodate the specified number of additional items. |
| public boolean | |
| public boolean | |
| public T | |
| public T | |
| public int | |
| public int | Returns: An index of first occurrence of value in array or -1 if no such value existsMay be null. value, boolean If true, == comparison will be used. If false, .equals() comparison will be used. identity)Returns the index of first occurrence of value in the array, or -1 if no such value exists. |
| public void | |
| public void | |
| public boolean | |
| public Array. | |
| public int | Returns: An index of last occurrence of value in array or -1 if no such value existsMay be null. value, boolean If true, == comparison will be used. If false, .equals() comparison will be used. identity)Returns an index of last occurrence of value in array or -1 if no such value exists. |
| public boolean | |
| public static <T> Array | |
| public static <T> Array | |
| public static <T> Array | |
| public static <T> Array | of(boolean ordered, int capacity, Class<T> arrayType)
Deprecated
Use
Array#of(boolean, int, ArraySupplier)
|
| public T | |
| public T | |
| public T | |
| public boolean | |
| public T | |
| public void | |
| public boolean | Returns: true if value was found and removed, false otherwiseMay be null. value, boolean If true, == comparison will be used. If false, .equals() comparison will be used. identity)Removes the first instance of the specified value in the array. |
| public int | Returns: the number of replacements doneMay be null. value, boolean If true, == comparison will be used. If false, .equals() comparison will be used. identity, T 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 replacedMay be null. value, boolean If true, == comparison will be used. If false, .equals() comparison will be used. identity, T 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 T[] | resize(int newSize)
Creates a new backing array with the specified size containing the current items. |
| public void | |
| public Iterable | |
| public T | Returns: the value of the Nth lowest ranked object.used for comparison comparator, int rank of desired object according to comparison, n is based on ordinal numbers, not array indices. for min
value use 1, for max value use size of array, using 0 results in runtime exception. kthLowest)Selects the nth-lowest element from the Array according to Comparator ranking. |
| public int | selectRankedIndex(Comparator<T>
used for comparison comparator, int rank of desired object according to comparison, n is based on ordinal numbers, not array indices. for min
value use 1, for max value use size of array, using 0 results in runtime exception. kthLowest)Returns: the index of the Nth lowest ranked object. |
| public void | |
| public T[] | |
| public T[] | |
| public void | |
| public void | |
| public void | |
| public void | |
| public T[] | |
| public T[] | |
| public <V> V[] | |
| public String | |
| public String | |
| public void | |
| public static <T> Array |
| items | back to summary |
|---|---|
| public T[] items Provides direct access to the underlying array. If the Array's generic type is not Object, this field may only be accessed
if the | |
| iterable | back to summary |
|---|---|
| private transient Array. | |
| ordered | back to summary |
|---|---|
| public boolean ordered | |
| predicateIterable | back to summary |
|---|---|
| private transient Predicate. | |
| size | back to summary |
|---|---|
| public int size | |
| Array | back to summary |
|---|---|
| public Array() Creates an ordered array with a capacity of 16. | |
| Array | back to summary |
|---|---|
| public Array(int capacity) Creates an ordered array with the specified capacity. | |
| Array | back to summary |
|---|---|
public Array(boolean ordered, int capacity)
| |
| Array | back to summary |
|---|---|
| public Array(boolean ordered, int capacity, ArraySupplier<T[]> arraySupplier) Creates a new array with
| |
| Array | back to summary |
|---|---|
| public Array(ArraySupplier<T[]> arraySupplier) Creates an ordered array with | |
| Array | back to summary |
|---|---|
| public Array(boolean ordered, int capacity, Class<T> arrayType)
Deprecated Use Creates a new array with
| |
| Array | back to summary |
|---|---|
| public Array(Class<T> arrayType)
Deprecated Use Creates an ordered array with
| |
| Array | back to summary |
|---|---|
| public Array(Array<? extends T> array) Creates a new array containing the elements in the specified array. The new array will have the same type of backing array and will be ordered if the specified 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. | |
| Array | back to summary |
|---|---|
| public Array(T[] array) Creates a new ordered array containing the elements in the specified array. The new array will have the same type of backing array. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be grown. | |
| Array | back to summary |
|---|---|
| public Array(boolean ordered, T[] array, int start, int count) Creates a new array containing the elements in the specified array. The new array will have the same type of backing 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(T value) | |
| add | back to summary |
|---|---|
| public void add(T value1, T value2) | |
| add | back to summary |
|---|---|
| public void add(T value1, T value2, T value3) | |
| add | back to summary |
|---|---|
| public void add(T value1, T value2, T value3, T value4) | |
| addAll | back to summary |
|---|---|
| public void addAll(Array<? extends T> array) | |
| addAll | back to summary |
|---|---|
| public void addAll(Array<? extends T> array, int start, int count) | |
| addAll | back to summary |
|---|---|
| public void addAll(T... array) | |
| addAll | back to summary |
|---|---|
| public void addAll(T[] array, int start, int count) | |
| clear | back to summary |
|---|---|
| public void clear() | |
| contains | back to summary |
|---|---|
| public boolean contains(T value, boolean identity) Returns true if this array contains the specified value.
| |
| containsAll | back to summary |
|---|---|
| public boolean containsAll(Array<? extends T> values, boolean identity) Returns true if this array contains all the specified values.
| |
| containsAny | back to summary |
|---|---|
| public boolean containsAny(Array<? extends T> values, boolean identity) Returns true if this array contains any the specified values.
| |
| ensureCapacity | back to summary |
|---|---|
| public T[] 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. Returns false if either array is unordered. | |
| equalsIdentity | back to summary |
|---|---|
| public boolean equalsIdentity(Object object) Uses == for comparison of each item. Returns false if either array is unordered. | |
| first | back to summary |
|---|---|
| public T first() Returns the first item. | |
| get | back to summary |
|---|---|
| public T 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
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(T value, boolean identity) Returns the index of first occurrence of value in the array, or -1 if no such value exists.
| |
| insert | back to summary |
|---|---|
| public void insert(int index, T 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. | |
| iterator | back to summary |
|---|---|
| public Array. Implements java. Returns an iterator for the items in the array. Remove is supported.
If | |
| lastIndexOf | back to summary |
|---|---|
| public int lastIndexOf(T value, boolean identity) Returns an index of last occurrence of value in array or -1 if no such value exists. Search is started from the end of an array.
| |
| notEmpty | back to summary |
|---|---|
| public boolean notEmpty() Returns true if the array has one or more items. | |
| of | back to summary |
|---|---|
public static <T> Array
| |
| of | back to summary |
|---|---|
public static <T> Array
| |
| of | back to summary |
|---|---|
| public static <T> Array Deprecated
| |
| of | back to summary |
|---|---|
| public static <T> Array Deprecated
| |
| peek | back to summary |
|---|---|
| public T peek() Returns the last item. | |
| pop | back to summary |
|---|---|
| public T pop() Removes and returns the last item. | |
| random | back to summary |
|---|---|
| public T random() Returns a random item from the array, or null if the array is empty.
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Array<? extends T> array, boolean identity) Removes from this array the first instance of each element contained in the specified array.
| |
| removeIndex | back to summary |
|---|---|
| public T 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(T value, boolean identity) Removes the first instance of the specified value in the array.
| |
| replaceAll | back to summary |
|---|---|
| public int replaceAll(T value, boolean identity, T replacement) Returns the number of replacements done.
| |
| replaceFirst | back to summary |
|---|---|
| public boolean replaceFirst(T value, boolean identity, T replacement) Returns true if the specified value was replaced successfully with the replacement
| |
| resize | back to summary |
|---|---|
| protected T[] resize(int newSize) Creates a new backing array with the specified size containing the current items. | |
| reverse | back to summary |
|---|---|
| public void reverse() | |
| select | back to summary |
|---|---|
| public Iterable Returns an iterable for the selected items in the array. Remove is supported, but not between hasNext() and next().
If | |
| selectRanked | back to summary |
|---|---|
| public T selectRanked(Comparator<T> comparator, int kthLowest) Selects the nth-lowest element from the Array according to Comparator ranking. This might partially sort the Array. The
array must have a size greater than 0, or a
| |
| selectRankedIndex | back to summary |
|---|---|
public int selectRankedIndex(Comparator<T> comparator, int kthLowest)
| |
| set | back to summary |
|---|---|
| public void set(int index, T value) | |
| setSize | back to summary |
|---|---|
| public T[] setSize(int newSize) Sets the array size, leaving any values beyond the current size null.
| |
| shrink | back to summary |
|---|---|
| public T[] 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() Sorts this array. The array elements must implement | |
| sort | back to summary |
|---|---|
| public void sort(Comparator<? super T> comparator) Sorts the array. This method is not thread safe (uses | |
| swap | back to summary |
|---|---|
| public void swap(int first, int second) | |
| toArray | back to summary |
|---|---|
| public T[] toArray() Returns the items as an array. Note the array is typed, so the | |
| toArray | back to summary |
|---|---|
| public T[] toArray(ArraySupplier<T[]> arraySupplier) | |
| toArray | back to summary |
|---|---|
| public <V> V[] toArray(Class<V> type)
Deprecated Use
| |
| 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 <T> Array
| |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final Array | |
| private transient Array. | |
| private transient Array. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Array. |
| allowRemove | back to summary |
|---|---|
| private final boolean allowRemove | |
| array | back to summary |
|---|---|
| private final Array<T> array | |
| iterator1 | back to summary |
|---|---|
| private transient Array. | |
| iterator2 | back to summary |
|---|---|
| private transient Array. | |
| ArrayIterable | back to summary |
|---|---|
| public ArrayIterable(Array<T> array) | |
| ArrayIterable | back to summary |
|---|---|
| public ArrayIterable(Array<T> array, boolean allowRemove) | |
| iterator | back to summary |
|---|---|
| public Array. Implements java. Doc from java. Returns an iterator over elements of type
| |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final Array | |
| pack-priv int | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Array. | |
| public T | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| public void |
| allowRemove | back to summary |
|---|---|
| private final boolean allowRemove | |
| array | back to summary |
|---|---|
| private final Array<T> array | |
| index | back to summary |
|---|---|
| pack-priv int index | |
| valid | back to summary |
|---|---|
| pack-priv boolean valid | |
| ArrayIterator | back to summary |
|---|---|
| public ArrayIterator(Array<T> array) | |
| ArrayIterator | back to summary |
|---|---|
| public ArrayIterator(Array<T> array, boolean allowRemove) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns | |
| iterator | back to summary |
|---|---|
| public Array. Implements java. Doc from java. Returns an iterator over elements of type | |
| next | back to summary |
|---|---|
| public T next() Implements java. Doc from java. Returns the next element in the iteration. | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |
| reset | back to summary |
|---|---|
| public void reset() | |