Changes made to this collection will actually be made on the decorated collection. Add and remove operations require the use of a pluggable strategy. If no strategy is provided then add and remove are unsupported.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | CompositeCollection.CollectionMutator<
the element being held in the collection E>Pluggable strategy to handle changes to the composite. |
| Modifier and Type | Field and Description |
|---|---|
| private final List | all
Collections in the composite |
| private CompositeCollection. | mutator
CollectionMutator to handle changes to the collection |
| private static final long | serialVersionUID
Serialization version |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CompositeCollection(final Collection<E>
the Collection to be appended to the composite compositeCollection)Create a Composite Collection with one collection. |
| public | CompositeCollection(final Collection<E>
the Collection to be appended to the composite compositeCollection1, final Collection<E> the Collection to be appended to the composite compositeCollection2)Create a Composite Collection with two collections. |
| public | CompositeCollection(final Collection<E>...
the collections to composite compositeCollections)Create a Composite Collection with an array of collections. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the collection was modifiedthe object to add obj)Implements java. |
| public boolean | Returns: true if the collection was modifiedthe collection to add coll)Implements java. |
| public void | addComposited(final Collection<E>
the Collection to be appended to the composite compositeCollection)Add these Collections to the list of collections in this composite |
| public void | addComposited(final Collection<E>
the Collection to be appended to the composite compositeCollection1, final Collection<E> the Collection to be appended to the composite compositeCollection2)Add these Collections to the list of collections in this composite |
| public void | addComposited(final Collection<E>...
the Collections to be appended to the composite compositeCollections)Add these Collections to the list of collections in this composite |
| public void | |
| public boolean | Returns: true if obj is contained in any of the contained collectionsthe object to search for obj)Implements java. |
| public boolean | Returns: true if all elements containedthe collection to check for coll)Implements java. |
| public List | Returns: Unmodifiable list of all collections in this composite.Gets the collections being decorated. |
| protected CompositeCollection. | Returns: CollectionMutator<E>Get the collection mutator to be used for this CompositeCollection. |
| public boolean | Returns: true if all of the contained collections are emptyImplements java. |
| public Iterator | Returns: anIteratorChain instance which supports
remove(). Iteration occurs over contained collections in
the order they were added, but this behavior should not be relied upon.Implements java. |
| public boolean | Returns: true if the collection is changedthe object being removed obj)Implements java. |
| public boolean | Returns: true if the collection was modifiedthe collection to remove coll)Implements java. |
| public void | removeComposited(final Collection<E>
collection to be removed coll)Removes a collection from the those being decorated in this composite. |
| public boolean | Returns: true if the collection was modifieda predicate which returns true for elements to be removed filter)Overrides default java. |
| public boolean | Returns: true if the collection was modifiedthe collection to remove coll)Implements java. |
| public void | setMutator(final CompositeCollection.
the mutator to use mutatorSpecify a CollectionMutator strategy instance to handle changes. |
| public int | Returns: total number of elements in all contained containersImplements java. |
| public Object[] | Returns: an object array of all the elements in the collectionImplements java. |
| public < the type of the elements in the collection T> T[] | Returns: an array of all the elements in the collectionthe array to use, populating if possible array)Implements java. |
| public Collection | Returns: A new ArrayList containing all of the elements in this composite. The new collection is not backed by this composite.Returns a new collection containing all of the elements |
| all | back to summary |
|---|---|
| private final List<Collection<E>> all Collections in the composite | |
| mutator | back to summary |
|---|---|
| private CompositeCollection. CollectionMutator to handle changes to the collection | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization version | |
| CompositeCollection | back to summary |
|---|---|
| public CompositeCollection() Create an empty CompositeCollection. | |
| CompositeCollection | back to summary |
|---|---|
| public CompositeCollection(final Collection<E> compositeCollection) Create a Composite Collection with one collection.
| |
| CompositeCollection | back to summary |
|---|---|
| public CompositeCollection(final Collection<E> compositeCollection1, final Collection<E> compositeCollection2) Create a Composite Collection with two collections.
| |
| CompositeCollection | back to summary |
|---|---|
| public CompositeCollection(final Collection<E>... compositeCollections) Create a Composite Collection with an array of collections.
| |
| add | back to summary |
|---|---|
| public boolean add(final E obj) Implements java. Adds an object to the collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(final Collection<? extends E> coll) Implements java. Adds a collection of elements to this collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
| |
| addComposited | back to summary |
|---|---|
| public void addComposited(final Collection<E> compositeCollection) Add these Collections to the list of collections in this composite
| |
| addComposited | back to summary |
|---|---|
| public void addComposited(final Collection<E> compositeCollection1, final Collection<E> compositeCollection2) Add these Collections to the list of collections in this composite
| |
| addComposited | back to summary |
|---|---|
| public void addComposited(final Collection<E>... compositeCollections) Add these Collections to the list of collections in this composite
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Removes all of the elements from this collection .
This implementation calls
| |
| contains | back to summary |
|---|---|
| public boolean contains(final Object obj) Implements java. Checks whether this composite collection contains the object.
This implementation calls | |
| containsAll | back to summary |
|---|---|
| public boolean containsAll(final Collection<?> coll) Implements java. Checks whether this composite contains all the elements in the specified collection.
This implementation calls
| |
| getCollections | back to summary |
|---|---|
| public List Gets the collections being decorated.
| |
| getMutator | back to summary |
|---|---|
| protected CompositeCollection. Get the collection mutator to be used for this CompositeCollection.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Checks whether this composite collection is empty.
This implementation calls
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Gets an iterator over all the collections in this composite.
This implementation uses an
| |
| remove | back to summary |
|---|---|
| public boolean remove(final Object obj) Implements java. Removes an object from the collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(final Collection<?> coll) Implements java. Removes the elements in the specified collection from this composite collection.
This implementation calls
| |
| removeComposited | back to summary |
|---|---|
| public void removeComposited(final Collection<E> coll) Removes a collection from the those being decorated in this composite.
| |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(final Predicate<? super E> filter) Overrides default java. Removes all of the elements of this collection that satisfy the given predicate from this composite collection.
This implementation calls
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(final Collection<?> coll) Implements java. Retains all the elements in the specified collection in this composite collection, removing all others.
This implementation calls
| |
| setMutator | back to summary |
|---|---|
| public void setMutator(final CompositeCollection. Specify a CollectionMutator strategy instance to handle changes.
| |
| size | back to summary |
|---|---|
| public int size() Implements java. Gets the size of this composite collection.
This implementation calls
| |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Implements java. Returns an array containing all of the elements in this composite. | |
| toArray | back to summary |
|---|---|
| public <T> T[] toArray(final T[] array) Implements java. Returns an object array, populating the supplied array if possible.
See
| |
| toCollection | back to summary |
|---|---|
| public Collection Returns a new collection containing all of the elements
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the collection is changedthe CompositeCollection being changed composite, List<Collection<E>> all of the Collection instances in this CompositeCollection collections, E the object being added obj)Called when an object is to be added to the composite. |
| public boolean | Returns: true if the collection is changedthe CompositeCollection being changed composite, List<Collection<E>> all of the Collection instances in this CompositeCollection collections, Collection<? extends E> the collection being added coll)Called when a collection is to be added to the composite. |
| public boolean | Returns: true if the collection is changedthe CompositeCollection being changed composite, List<Collection<E>> all of the Collection instances in this CompositeCollection collections, Object the object being removed obj)Called when an object is to be removed to the composite. |
| add | back to summary |
|---|---|
| public boolean add(CompositeCollection<E> composite, List<Collection<E>> collections, E obj) Called when an object is to be added to the composite.
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(CompositeCollection<E> composite, List<Collection<E>> collections, Collection<? extends E> coll) Called when a collection is to be added to the composite.
| |
| remove | back to summary |
|---|---|
| public boolean remove(CompositeCollection<E> composite, List<Collection<E>> collections, Object obj) Called when an object is to be removed to the composite.
| |