Java com.badlogic.gdx.utils Array fields, constructors, methods, implement or subclass

Example usage for Java com.badlogic.gdx.utils Array fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.badlogic.gdx.utils Array.

The text is from its open source code.

Subclass

com.badlogic.gdx.utils.Array has subclasses.
Click this link to see all its subclasses.

Constructor

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 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.

Method

voidadd(T value)
voidaddAll(Array array)
voidaddAll(T... array)
voidaddAll(Array array, int offset, int length)
voidaddAll(T[] array, int offset, int length)
voidclear()
booleancontains(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.
booleanequals(Object object)
Tfirst()
Returns the first item.
Tget(int index)
intindexOf(T value, boolean identity)
Returns an index of first occurrence of value in array or -1 if no such value exists
voidinsert(int index, T value)
Iteratoriterator()
Returns an iterator for the items in the array.
Tpeek()
Returns the last item.
Tpop()
Removes and returns the last item.
Trandom()
Returns a random item from the array, or null if the array is empty.
booleanremoveAll(Array array, boolean identity)
Removes from this array all of elements contained in the specified array.
TremoveIndex(int index)
Removes and returns the item at the specified index.
booleanremoveValue(T value, boolean identity)
Removes the first instance of the specified value in the array.
voidreverse()
voidset(int index, T value)
T[]shrink()
Reduces the size of the backing array to the size of the actual items.
voidshuffle()
voidsort(Comparator comparator)
Sorts the array.
voidsort()
Sorts this array.
T[]toArray()
Returns the items as an array.
V[]toArray(Class type)
StringtoString(String separator)
voidtruncate(int newSize)
Reduces the size of the array to the specified size.