public final class ImmutableArrayCharList extends AbstractCharList
CharList 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.
AbstractCharList.PListIterator| Modifier and Type | Method and Description |
|---|---|
protected void |
arrayCopy(int fromIndex,
char[] dest,
int destIndex,
int size)
Copies data from this collection into the specified array.
|
java.lang.Object |
clone()
Clone implementation that returns
this. |
boolean |
contains(char value)
Checks whether this collection contains a specified primitive value.
|
static ImmutableArrayCharList |
copyOf(char[] values)
Creates a list copying the specified array.
|
static ImmutableArrayCharList |
copyOf(java.util.Collection<java.lang.Character> coll)
Creates a list copying the values from the specified collection.
|
static ImmutableArrayCharList |
empty()
Gets a list that is empty.
|
char |
getChar(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, firstChar, get, hashCode, indexOf, indexOf, indexOf, indexOf, isModifiable, isSetModifiable, iterator, last, lastChar, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, removeChar, removeCharAt, removeRange, set, set, subList, toCharArray, toStringContentsaddAll, 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, toCharArray, toCharArray, toObject, toPrimitive, toPrimitiveArray, toStringisEmpty, optimizefinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayaddAll, addAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, removeAll, removeAll, removeAll, removeAll, removeFirst, retainAll, retainAll, retainAll, toCharArray, toCharArraycontainsAnyisEmpty, optimizepublic static ImmutableArrayCharList empty()
public static ImmutableArrayCharList copyOf(char[] values)
values - an array of values to copy, null treated as zero size arraypublic static ImmutableArrayCharList copyOf(java.util.Collection<java.lang.Character> 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 char getChar(int index)
index - the index to get fromjava.lang.IndexOutOfBoundsException - if the index is invalidpublic boolean contains(char value)
This implementation accesses the internal storage array directly.
contains in interface CharCollectioncontains in class AbstractCharListvalue - the value to search fortrue if the value is foundpublic java.lang.Object clone()
this.clone in interface PrimitiveCollectable<java.lang.Character>clone in class AbstractPrimitiveCollectable<java.lang.Character>thisprotected void arrayCopy(int fromIndex,
char[] dest,
int destIndex,
int size)
arrayCopy in class AbstractCharListfromIndex - the index to start fromdest - the destination arraydestIndex - the destination start indexsize - the number of items to copyCopyright © 2005–2018 Joda.org. All rights reserved.