public class IntList extends ManagedIntArray
array, size
Constructor and Description |
---|
IntList() |
Modifier and Type | Method and Description |
---|---|
void |
add(int value)
Adds an element to the end of the list.
|
void |
addAll(IntList values)
Adds all elements of the given list to the end of the list.
|
int |
get(int index)
Returns the element at the given index.
|
java.util.List<java.lang.Integer> |
getAsList()
Returns the int list as an actual list.
|
int |
getSize()
Returns the size of the list.
|
void |
set(int index,
int value)
Set the element at the given index.
|
addArrayElement, addArrayElements
public IntList()
public int getSize()
public int get(int index)
ArrayIndexOutOfBoundsException
, and
sometimes just 0 returned, depending on if you reached existing memory by
chance.public void set(int index, int value)
ArrayIndexOutOfBoundsException
, and sometimes
not for illegal indexes, depending on whether you hit memory allocated by the
exponential growth strategy by chance.public void add(int value)
public void addAll(IntList values)
public java.util.List<java.lang.Integer> getAsList()