E - Element typepublic class UnmodifiableArrayList<E> extends AbstractList<E> implements RandomAccess
Since the array is not copied, modifications to the array will be reflected in the list.
Null elements are allowed.
Quick and low-memory, like Arrays.asList(Object[]), but
unmodifiable.
modCount| Modifier and Type | Method and Description |
|---|---|
E |
get(int index) |
static <E> UnmodifiableArrayList<E> |
of(E... elements) |
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringpublic static <E> UnmodifiableArrayList<E> of(E... elements)
public E get(int index)
public int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.