public final class ArrayInt extends ListInt implements Serializable
int[]
into a ListInt
.Constructor and Description |
---|
ArrayInt(int... array)
A new
ArrayInt that wraps around the given array. |
ArrayInt(int[] array,
boolean readOnly)
A new
ArrayInt that wraps around the given array. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getInt(int index)
Returns the element at the specified position in this list casted to an int.
|
IteratorInt |
iterator()
Returns an iterator over the elements of the collection.
|
void |
setInt(int index,
int value)
Changes the element at the specified position, casting to the internal
representation.
|
int |
size()
Returns the number of elements in the collection.
|
public ArrayInt(int... array)
ArrayInt
that wraps around the given array.array
- an arraypublic ArrayInt(int[] array, boolean readOnly)
ArrayInt
that wraps around the given array.array
- an arrayreadOnly
- if false the wrapper allows writes to the arraypublic final IteratorInt iterator()
CollectionNumber
iterator
in interface CollectionInt
iterator
in interface CollectionNumber
iterator
in class ListInt
public final int size()
CollectionNumber
size
in interface CollectionNumber
public int getInt(int index)
ListNumber
getInt
in interface ListNumber
index
- position of the element to returnpublic void setInt(int index, int value)
ListNumber
setInt
in interface ListNumber
setInt
in class ListInt
index
- position of the element to changevalue
- the new valueCopyright © 2015. All rights reserved.