Package com.amazon.ion.impl.bin
Class IntList
java.lang.Object
com.amazon.ion.impl.bin.IntList
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIntList()Constructs a new IntList with a capacity ofDEFAULT_INITIAL_CAPACITY.IntList(int initialCapacity) Constructs a new IntList with the specified capacity.Constructs a new IntList that contains all the elements of the given IntList. -
Method Summary
-
Field Details
-
DEFAULT_INITIAL_CAPACITY
public static final int DEFAULT_INITIAL_CAPACITY- See Also:
-
-
Constructor Details
-
IntList
public IntList()Constructs a new IntList with a capacity ofDEFAULT_INITIAL_CAPACITY. -
IntList
public IntList(int initialCapacity) Constructs a new IntList with the specified capacity.- Parameters:
initialCapacity- The number of ints that can be stored in this IntList before it will need to be reallocated.
-
IntList
Constructs a new IntList that contains all the elements of the given IntList.- Parameters:
other- the IntList to copy.
-
-
Method Details
-
size
public int size()Accessor.- Returns:
- The number of ints currently stored in the list.
-
isEmpty
public boolean isEmpty()- Returns:
trueif there are ints stored in the list.
-
clear
public void clear()Empties the list. Note that this method does not shrink the size of the backing data store. -
get
public int get(int index) Returns theindexth int in the list.- Parameters:
index- The list index of the desired int.- Returns:
- The int at index
indexin the list. - Throws:
IndexOutOfBoundsException- if the index is negative or greater than the number of ints stored in the list.
-
add
public void add(int value) Appends an int to the end of the list, growing the list if necessary.- Parameters:
value- The int to add to the end of the list.
-
toString
-