public final class UnmodifiableList extends AbstractSerializableListDecorator implements Unmodifiable
List
to ensure it can't be altered.
This class is Serializable from Commons Collections 3.1.
collection
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object object) |
boolean |
add(Object object) |
boolean |
addAll(Collection coll) |
boolean |
addAll(int index,
Collection coll) |
void |
clear() |
static List |
decorate(List list)
Factory method to create an unmodifiable list.
|
Iterator |
iterator() |
ListIterator |
listIterator() |
ListIterator |
listIterator(int index) |
Object |
remove(int index) |
boolean |
remove(Object object) |
boolean |
removeAll(Collection coll) |
boolean |
retainAll(Collection coll) |
Object |
set(int index,
Object object) |
List |
subList(int fromIndex,
int toIndex) |
get, getList, indexOf, lastIndexOf
contains, containsAll, equals, getCollection, hashCode, isEmpty, size, toArray, toArray, toString
public static List decorate(List list)
list
- the list to decorate, must not be nullIllegalArgumentException
- if list is nullpublic Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface List
iterator
in class AbstractCollectionDecorator
public boolean add(Object object)
add
in interface Collection
add
in interface List
add
in class AbstractCollectionDecorator
public boolean addAll(Collection coll)
addAll
in interface Collection
addAll
in interface List
addAll
in class AbstractCollectionDecorator
public void clear()
clear
in interface Collection
clear
in interface List
clear
in class AbstractCollectionDecorator
public boolean remove(Object object)
remove
in interface Collection
remove
in interface List
remove
in class AbstractCollectionDecorator
public boolean removeAll(Collection coll)
removeAll
in interface Collection
removeAll
in interface List
removeAll
in class AbstractCollectionDecorator
public boolean retainAll(Collection coll)
retainAll
in interface Collection
retainAll
in interface List
retainAll
in class AbstractCollectionDecorator
public ListIterator listIterator()
listIterator
in interface List
listIterator
in class AbstractListDecorator
public ListIterator listIterator(int index)
listIterator
in interface List
listIterator
in class AbstractListDecorator
public void add(int index, Object object)
add
in interface List
add
in class AbstractListDecorator
public boolean addAll(int index, Collection coll)
addAll
in interface List
addAll
in class AbstractListDecorator
public Object remove(int index)
remove
in interface List
remove
in class AbstractListDecorator
public Object set(int index, Object object)
set
in interface List
set
in class AbstractListDecorator
public List subList(int fromIndex, int toIndex)
subList
in interface List
subList
in class AbstractListDecorator
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.