public final class ImmutableArrayShortList extends AbstractShortList
ShortList 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.
AbstractShortList.PListIterator| Modifier and Type | Method and Description |
|---|---|
protected void |
arrayCopy(int fromIndex,
short[] dest,
int destIndex,
int size)
Copies data from this collection into the specified array.
|
Object |
clone()
Clone implementation that returns
this. |
boolean |
contains(short value)
Checks whether this collection contains a specified primitive value.
|
static ImmutableArrayShortList |
copyOf(Collection<Short> coll)
Creates a list copying the values from the specified collection.
|
static ImmutableArrayShortList |
copyOf(short[] values)
Creates a list copying the specified array.
|
static ImmutableArrayShortList |
empty()
Gets a list that is empty.
|
short |
getShort(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, firstShort, get, hashCode, indexOf, indexOf, indexOf, indexOf, isModifiable, isSetModifiable, iterator, last, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastShort, listIterator, listIterator, remove, removeRange, removeShort, removeShortAt, set, set, subList, toShortArrayaddAll, 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, toObject, toPrimitive, toPrimitiveArray, toShortArray, toShortArray, toStringisEmpty, optimizefinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayaddAll, addAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, removeAll, removeAll, removeAll, removeAll, removeFirst, retainAll, retainAll, retainAll, toShortArray, toShortArraycontainsAnyisEmpty, optimizepublic static ImmutableArrayShortList empty()
public static ImmutableArrayShortList copyOf(short[] values)
values - an array of values to copy, null treated as zero size arraypublic static ImmutableArrayShortList copyOf(Collection<Short> 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 short getShort(int index)
index - the index to get fromIndexOutOfBoundsException - if the index is invalidpublic boolean contains(short value)
This implementation accesses the internal storage array directly.
contains in interface ShortCollectioncontains in class AbstractShortListvalue - the value to search fortrue if the value is foundpublic Object clone()
this.clone in interface PrimitiveCollectable<Short>clone in class AbstractPrimitiveCollectable<Short>thisprotected void arrayCopy(int fromIndex, short[] dest, int destIndex, int size)
arrayCopy in class AbstractShortListfromIndex - 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.