public final class ImmutableArrayIntList extends AbstractIntList
IntList
for
primitive int
elements.
This class implements List
allowing
seamless integration with other APIs.
Add, Remove, Set and Clear are not supported as this class is immutable.
AbstractIntList.PListIterator
Modifier and Type | Method and Description |
---|---|
protected void |
arrayCopy(int fromIndex,
int[] dest,
int destIndex,
int size)
Copies data from this collection into the specified array.
|
Object |
clone()
Clone implementation that returns
this . |
boolean |
contains(int value)
Checks whether this collection contains a specified primitive value.
|
static ImmutableArrayIntList |
copyOf(Collection<Integer> coll)
Creates a list copying the values from the specified collection.
|
static ImmutableArrayIntList |
copyOf(int[] values)
Creates a list copying the specified array.
|
static ImmutableArrayIntList |
empty()
Gets a list that is empty.
|
int |
getInt(int index)
Gets the primitive value at the specified index.
|
int |
size()
Gets the current size of the collection.
|
add, add, add, add, addAll, addAll, addAll, checkIndex, checkIndexExists, checkRange, checkSetModifiable, clear, equals, first, firstInt, get, hashCode, indexOf, indexOf, indexOf, indexOf, isModifiable, isSetModifiable, iterator, last, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastInt, listIterator, listIterator, remove, removeInt, removeIntAt, removeRange, set, set, subList, toIntArray
addAll, addAll, addAll, checkAddModifiable, checkRemoveModifiable, contains, containsAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, containsAny, isAddModifiable, isRemoveModifiable, isToPrimitivePossible, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeFirst, retainAll, retainAll, retainAll, retainAll, toArray, toArray, toIntArray, toIntArray, toObject, toPrimitive, toPrimitiveArray, toString
isEmpty, optimize
finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
addAll, addAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, removeAll, removeAll, removeAll, removeAll, removeFirst, retainAll, retainAll, retainAll, toIntArray, toIntArray
containsAny
isEmpty, optimize
public static ImmutableArrayIntList empty()
public static ImmutableArrayIntList copyOf(int[] values)
values
- an array of values to copy, null treated as zero size arraypublic static ImmutableArrayIntList copyOf(Collection<Integer> coll)
If the collection is an instance of this class, then it is simply returned.
coll
- a collection of values to copy, null treated as zero size collectionpublic int size()
public int getInt(int index)
index
- the index to get fromIndexOutOfBoundsException
- if the index is invalidpublic boolean contains(int value)
This implementation accesses the internal storage array directly.
contains
in interface IntCollection
contains
in class AbstractIntList
value
- the value to search fortrue
if the value is foundpublic Object clone()
this
.clone
in interface PrimitiveCollectable<Integer>
clone
in class AbstractPrimitiveCollectable<Integer>
this
protected void arrayCopy(int fromIndex, int[] dest, int destIndex, int size)
arrayCopy
in class AbstractIntList
fromIndex
- the index to start fromdest
- the destination arraydestIndex
- the destination start indexsize
- the number of items to copyCopyright © 2005-2012 Joda.org. All Rights Reserved.