⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.collection

Class UnmodifiableCollection

java.lang.Object
|
+--org.apache.commons.collections.collection.AbstractCollectionDecorator
   |
   +--org.apache.commons.collections.collection.UnmodifiableCollection

All Implemented Interfaces:
Collection, Unmodifiable


public final class UnmodifiableCollection
extends AbstractCollectionDecorator
implements Unmodifiable

Decorates another Collection to ensure it can't be altered.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Method Summary

boolean

add(Object object)

boolean

addAll(Collection coll)

void

clear()

static Collection

decorate(Collection coll)

Factory method to create an unmodifiable collection.

Iterator

iterator()

boolean

remove(Object object)

boolean

removeAll(Collection coll)

boolean

retainAll(Collection coll)

Method Details

add

public boolean add(Object object)

Parameters:
object

addAll

public boolean addAll(Collection coll)

Parameters:
coll

clear

public void clear()


decorate

public static Collection decorate(Collection coll)

Factory method to create an unmodifiable collection.

Parameters:
coll - the collection to decorate, must not be null
Throws:
- if collection is null

iterator

public Iterator iterator()


remove

public boolean remove(Object object)

Parameters:
object

removeAll

public boolean removeAll(Collection coll)

Parameters:
coll

retainAll

public boolean retainAll(Collection coll)

Parameters:
coll