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