java.lang.Object | +--org.apache.commons.collections.collection.CompositeCollectionAll Implemented Interfaces:
Collection[] | Collections in the composite |
CollectionMutator to handle changes to the collection |
Create an empty CompositeCollection. |
CompositeCollection(Collection coll) Create a Composite Collection with only coll composited. |
CompositeCollection(Collection[] colls) Create a CompositeCollection with colls as the initial list of composited collections. |
boolean | add(Object obj) Adds an object to the collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified. |
boolean | addAll(Collection coll) Adds a collection of elements to this collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified. |
void | addComposited(Collection[] comps) Add these Collections to the list of collections in this composite |
void | addComposited(Collection c) Add an additional collection to this composite. |
void | addComposited(Collection c, Collection d) Add two additional collection to this composite. |
void | clear() Removes all of the elements from this collection . |
boolean | contains(Object obj) Checks whether this composite collection contains the object. |
boolean | containsAll(Collection coll) Checks whether this composite contains all the elements in the specified collection. |
Collection | Gets the collections being decorated. |
boolean | isEmpty() Checks whether this composite collection is empty. |
Iterator | iterator() Gets an iterator over all the collections in this composite. |
boolean | remove(Object obj) Removes an object from the collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified. |
boolean | removeAll(Collection coll) Removes the elements in the specified collection from this composite collection. |
void | removeComposited(Collection coll) Removes a collection from the those being decorated in this composite. |
boolean | retainAll(final Collection coll) Retains all the elements in the specified collection in this composite collection, removing all others. |
void | setMutator(CompositeCollection.CollectionMutator mutator) Specify a CollectionMutator strategy instance to handle changes. |
int | size() Gets the size of this composite collection. |
Object[] | toArray() Returns an array containing all of the elements in this composite. |
Object[] | toArray(Object[] array) Returns an object array, populating the supplied array if possible. |
Collection | Returns a new collection containing all of the elements |
protected Collection[] all
protected CompositeCollection.CollectionMutator mutator
public CompositeCollection()
public CompositeCollection(Collection coll)
public CompositeCollection(Collection[] colls)
public boolean add(Object obj)
- if CollectionMutator hasn't been set
- if add is unsupported
- if the object cannot be added due to its type
- if the object cannot be added because its null
- if the object cannot be addedpublic boolean addAll(Collection coll)
- if CollectionMutator hasn't been set
- if add is unsupported
- if the object cannot be added due to its type
- if the object cannot be added because its null
- if the object cannot be addedpublic void addComposited(Collection c, Collection d)
public void addComposited(Collection c)
public void addComposited(Collection[] comps)
public void clear()
clear()
on each collection.
- if clear is unsupportedpublic boolean contains(Object obj)
contains()
on each collection.
public boolean containsAll(Collection coll)
contains()
for each element in the
specified collection.
public Collection getCollections()
public boolean isEmpty()
isEmpty()
on each collection.
public Iterator iterator()
IteratorChain
.
IteratorChain
public boolean remove(Object obj)
- if removed is unsupported
- if the object cannot be removed due to its type
- if the object cannot be removed because its null
- if the object cannot be removedpublic boolean removeAll(Collection coll)
removeAll
on each collection.
- if removeAll is unsupportedpublic void removeComposited(Collection coll)
public boolean retainAll(final Collection coll)
retainAll()
on each collection.
- if retainAll is unsupportedpublic void setMutator(CompositeCollection.CollectionMutator mutator)
public int size()
size()
on each collection.
public Object[] toArray()
public Object[] toArray(Object[] array)
Collection
interface for full details.
public Collection toCollection()