Example usage for Java com.badlogic.gdx.utils Array fields, constructors, methods, implement or subclass
The text is from its open source code.
Array() Creates an ordered array with a capacity of 16. | |
Array(int capacity) Creates an ordered array with the specified capacity. | |
Array(Class arrayType) Creates an ordered array with #items of the specified type and a capacity of 16. | |
Array(Array extends T> array) Creates a new array containing the elements in the specified array. | |
Array(T[] array) Creates a new ordered array containing the elements in the specified array. | |
Array(boolean ordered, int capacity) | |
Array(boolean ordered, int capacity, Class arrayType) Creates a new array with #items of the specified type. |
void | add(T value) |
void | addAll(Array extends T> array) |
void | addAll(T... array) |
void | addAll(Array extends T> array, int offset, int length) |
void | addAll(T[] array, int offset, int length) |
void | clear() |
boolean | contains(T value, boolean identity) Returns if this array contains value. |
T[] | ensureCapacity(int additionalCapacity) Increases the size of the backing array to accommodate the specified number of additional items. |
boolean | equals(Object object) |
T | first() Returns the first item. |
T | get(int index) |
int | indexOf(T value, boolean identity) Returns an index of first occurrence of value in array or -1 if no such value exists |
void | insert(int index, T value) |
Iterator | iterator() Returns an iterator for the items in the array. |
T | peek() Returns the last item. |
T | pop() Removes and returns the last item. |
T | random() Returns a random item from the array, or null if the array is empty. |
boolean | removeAll(Array extends T> array, boolean identity) Removes from this array all of elements contained in the specified array. |
T | removeIndex(int index) Removes and returns the item at the specified index. |
boolean | removeValue(T value, boolean identity) Removes the first instance of the specified value in the array. |
void | reverse() |
void | set(int index, T value) |
T[] | shrink() Reduces the size of the backing array to the size of the actual items. |
void | shuffle() |
void | sort(Comparator super T> comparator) Sorts the array. |
void | sort() Sorts this array. |
T[] | toArray() Returns the items as an array. |
V[] | toArray(Class type) |
String | toString(String separator) |
void | truncate(int newSize) Reduces the size of the array to the specified size. |