public class UnmodifiableArrayList<T>
extends java.util.AbstractList<T>
implements java.util.RandomAccess
| Constructor and Description |
|---|
UnmodifiableArrayList(T[] elements,
int size)
The given elements are used directly (a defensive copy is not made),
and the given size is used as the size of this list.
|
| Modifier and Type | Method and Description |
|---|---|
T |
get(int index) |
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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate T[] elements
private final int size
public UnmodifiableArrayList(T[] elements, int size)
elements - The elements to use.size - The size must be <= the length of the elements arraypublic T get(int index)