public final class ImmutableArrayByteList extends AbstractByteList
ByteList
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.
AbstractByteList.PListIterator
Modifier and Type | Method and Description |
---|---|
protected void |
arrayCopy(int fromIndex,
byte[] dest,
int destIndex,
int size)
Copies data from this collection into the specified array.
|
Object |
clone()
Clone implementation that returns
this . |
boolean |
contains(byte value)
Checks whether this collection contains a specified primitive value.
|
static ImmutableArrayByteList |
copyOf(byte[] values)
Creates a list copying the specified array.
|
static ImmutableArrayByteList |
copyOf(Collection<Byte> coll)
Creates a list copying the values from the specified collection.
|
static ImmutableArrayByteList |
empty()
Gets a list that is empty.
|
byte |
getByte(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, firstByte, get, hashCode, indexOf, indexOf, indexOf, indexOf, isModifiable, isSetModifiable, iterator, last, lastByte, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, removeByte, removeByteAt, removeRange, set, set, subList, toByteArray
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, toByteArray, toByteArray, 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, toByteArray, toByteArray
containsAny
isEmpty, optimize
public static ImmutableArrayByteList empty()
public static ImmutableArrayByteList copyOf(byte[] values)
values
- an array of values to copy, null treated as zero size arraypublic static ImmutableArrayByteList copyOf(Collection<Byte> 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 byte getByte(int index)
index
- the index to get fromIndexOutOfBoundsException
- if the index is invalidpublic boolean contains(byte value)
This implementation accesses the internal storage array directly.
contains
in interface ByteCollection
contains
in class AbstractByteList
value
- the value to search fortrue
if the value is foundpublic Object clone()
this
.clone
in interface PrimitiveCollectable<Byte>
clone
in class AbstractPrimitiveCollectable<Byte>
this
protected void arrayCopy(int fromIndex, byte[] dest, int destIndex, int size)
arrayCopy
in class AbstractByteList
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.