|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
org.apache.commons.collections4.collection.UnmodifiableCollection<E>
E
- the type of the elements in the collectionpublic final class UnmodifiableCollection<E>
Decorates another Collection
to ensure it can't be altered.
This class is Serializable from Commons Collections 3.1.
Attempts to modify it will result in an UnsupportedOperationException.
Method Summary | ||
---|---|---|
boolean |
add(E object)
|
|
boolean |
addAll(Collection<? extends E> coll)
|
|
void |
clear()
|
|
Iterator<E> |
iterator()
|
|
boolean |
remove(Object object)
|
|
boolean |
removeAll(Collection<?> coll)
|
|
boolean |
retainAll(Collection<?> coll)
|
|
static
|
unmodifiableCollection(Collection<T> coll)
Factory method to create an unmodifiable collection. |
Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator |
---|
contains, containsAll, decorated, equals, hashCode, isEmpty, setCollection, size, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static <T> Collection<T> unmodifiableCollection(Collection<T> coll)
If the collection passed in is already unmodifiable, it is returned.
T
- the type of the elements in the collectioncoll
- the collection to decorate, must not be null
IllegalArgumentException
- if collection is nullpublic Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in class AbstractCollectionDecorator<E>
public boolean add(E object)
add
in interface Collection<E>
add
in class AbstractCollectionDecorator<E>
public boolean addAll(Collection<? extends E> coll)
addAll
in interface Collection<E>
addAll
in class AbstractCollectionDecorator<E>
public void clear()
clear
in interface Collection<E>
clear
in class AbstractCollectionDecorator<E>
public boolean remove(Object object)
remove
in interface Collection<E>
remove
in class AbstractCollectionDecorator<E>
public boolean removeAll(Collection<?> coll)
removeAll
in interface Collection<E>
removeAll
in class AbstractCollectionDecorator<E>
public boolean retainAll(Collection<?> coll)
retainAll
in interface Collection<E>
retainAll
in class AbstractCollectionDecorator<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |