public class UnmodifiableList<E>
extends java.lang.Object
implements java.util.List<E>, java.io.Serializable
This is a read-only wrapper around any java.util.List. Query
operations will "read through" to the specified list. Attempts to modify the
list directly or via its iterator will result in a
java.lang.UnsupportedOperationException.
| Constructor and Description |
|---|
UnmodifiableList(java.util.List<? extends E> list) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element) |
void |
add(int index,
E element) |
boolean |
addAll(java.util.Collection<? extends E> collection) |
boolean |
addAll(int index,
java.util.Collection<? extends E> collection) |
void |
clear() |
boolean |
contains(java.lang.Object object) |
boolean |
containsAll(java.util.Collection<?> collection) |
boolean |
equals(java.lang.Object object) |
E |
get(int index) |
int |
hashCode() |
int |
indexOf(java.lang.Object object) |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int index) |
E |
remove(int index) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> collection) |
boolean |
retainAll(java.util.Collection<?> collection) |
E |
set(int index,
E element) |
int |
size() |
java.util.List<E> |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
public UnmodifiableList(java.util.List<? extends E> list)
public boolean add(E element)
public boolean addAll(java.util.Collection<? extends E> collection)
public boolean addAll(int index,
java.util.Collection<? extends E> collection)
addAll in interface java.util.List<E>public void clear()
public boolean contains(java.lang.Object object)
public boolean containsAll(java.util.Collection<?> collection)
public boolean equals(java.lang.Object object)
public int hashCode()
public int indexOf(java.lang.Object object)
indexOf in interface java.util.List<E>public boolean isEmpty()
public java.util.Iterator<E> iterator()
public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<E>public java.util.ListIterator<E> listIterator()
listIterator in interface java.util.List<E>public java.util.ListIterator<E> listIterator(int index)
listIterator in interface java.util.List<E>public boolean remove(java.lang.Object object)
public boolean removeAll(java.util.Collection<?> collection)
public boolean retainAll(java.util.Collection<?> collection)
public int size()
public java.util.List<E> subList(int fromIndex, int toIndex)
subList in interface java.util.List<E>public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
public java.lang.String toString()
toString in class java.lang.Object