Changes made to this set will actually be made on the decorated set. Add operations require the use of a pluggable strategy. If no strategy is provided then add is unsupported.
From version 4.0, this class does not extend
CompositeCollection
anymore due to its input restrictions (only accepts Sets).
See COLLECTIONS-424
for more details.
| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| private final List | all
Sets in the composite |
| private CompositeSet. | mutator
SetMutator to handle changes to the collection |
| private static final long | serialVersionUID
Serialization version |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CompositeSet(final Set<E>
the initial set in the composite set)Create a CompositeSet with just |
| public | CompositeSet(final Set<E>...
the initial sets in the composite sets)Create a composite set with sets as the initial set of composited Sets. |
| 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 composite was modifiedthe collection to add coll)Implements java. |
| public synchronized void | |
| public void | addComposited(final Set<E>
the first Set to be appended to the composite set1, final Set<E> the second Set to be appended to the composite set2)Add these Sets to the list of sets in this composite. |
| public void | addComposited(final Set<E>...
the Sets to be appended to the composite sets)Add these Sets to the list of sets in this composite |
| public void | |
| public boolean | Returns: true if obj is contained in any of the contained setsthe object to search for obj)Implements java. |
| public boolean | Returns: true if all elements containedthe collection to check for coll)Implements java. |
| public boolean | equals(final Object
object to be compared for equality with this set obj)Overrides java. Implements java. |
| protected CompositeSet. | |
| public List | |
| public int | hashCode()
Overrides java. Implements java. |
| public boolean | Returns: true if all of the contained sets 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 object is removed, false otherwiseobject to be removed obj)Implements java. CollectionMutator is defined for this CompositeSet then this
method will be called anyway.
|
| public boolean | Returns: true if the composite was modifiedthe collection to remove coll)Implements java. |
| public void | removeComposited(final Set<E>
set to be removed set)Removes a set from those being decorated in this composite. |
| public boolean | removeIf(Predicate<? super E>
a predicate which returns filter)true for elements to be
removedOverrides default java. |
| public boolean | Returns: true if the composite was modifiedthe collection to remove coll)Implements java. |
| public void | setMutator(final CompositeSet.
the mutator to use mutatorSpecify a SetMutator 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 Set | Returns: A new HashSet containing all of the elements in this composite. The new collection is not backed by this composite.Returns a new Set containing all of the elements. |
| all | back to summary |
|---|---|
| private final List<Set<E>> all Sets in the composite | |
| mutator | back to summary |
|---|---|
| private CompositeSet. SetMutator to handle changes to the collection | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization version | |
| CompositeSet | back to summary |
|---|---|
| public CompositeSet() Create an empty CompositeSet. | |
| CompositeSet | back to summary |
|---|---|
| public CompositeSet(final Set<E> set) Create a CompositeSet with just
| |
| CompositeSet | back to summary |
|---|---|
| public CompositeSet(final Set<E>... sets) Create a composite set with sets as the initial set of composited Sets.
| |
| add | back to summary |
|---|---|
| public boolean add(final E obj) Implements java. Adds an object to the collection, throwing UnsupportedOperationException unless a SetMutator strategy is specified.
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(final Collection<? extends E> coll) Implements java. Adds a collection of elements to this composite, throwing UnsupportedOperationException unless a SetMutator strategy is specified.
| |
| addComposited | back to summary |
|---|---|
| public synchronized void addComposited(final Set<E> set) Add a Set to this composite.
| |
| addComposited | back to summary |
|---|---|
| public void addComposited(final Set<E> set1, final Set<E> set2) Add these Sets to the list of sets in this composite. | |
| addComposited | back to summary |
|---|---|
| public void addComposited(final Set<E>... sets) Add these Sets to the list of sets in this composite
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Removes all of the elements from this composite set.
This implementation calls
| |
| contains | back to summary |
|---|---|
| public boolean contains(final Object obj) Implements java. Checks whether this composite set 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
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Implements java. Doc from java. Compares the specified object with this set for equality. Returns
| |
| getMutator | back to summary |
|---|---|
| protected CompositeSet. Get the set mutator to be used for this CompositeSet.
| |
| getSets | back to summary |
|---|---|
| public List Gets the sets being decorated. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this set. The hash code of a set is
defined to be the sum of the hash codes of the elements in the set,
where the hash code of a
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Checks whether this composite set is empty.
This implementation calls
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Gets an iterator over all the sets in this composite.
This implementation uses an
| |
| remove | back to summary |
|---|---|
| public boolean remove(final Object obj) Implements java. If a | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(final Collection<?> coll) Implements java. Removes the elements in the specified collection from this composite set.
This implementation calls
| |
| removeComposited | back to summary |
|---|---|
| public void removeComposited(final Set<E> set) Removes a set from those being decorated in this composite.
| |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(Predicate<? super E> filter) Overrides default java. Doc from java. Removes all of the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller. | |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(final Collection<?> coll) Implements java. Retains all the elements in the specified collection in this composite set, removing all others.
This implementation calls
| |
| setMutator | back to summary |
|---|---|
| public void setMutator(final CompositeSet. Specify a SetMutator strategy instance to handle changes.
| |
| size | back to summary |
|---|---|
| public int size() Implements java. Gets the size of this composite set.
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
| |
| toSet | back to summary |
|---|---|
| public Set Returns a new Set containing all of the elements.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the collection is changedthe CompositeSet being changed composite, List<Set<E>> all of the Set instances in this CompositeSet sets, 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 CompositeSet being changed composite, List<Set<E>> all of the Set instances in this CompositeSet sets, Collection<? extends E> the collection being added coll)Called when a collection is to be added to the composite. |
| public void | resolveCollision(CompositeSet<E>
the CompositeSet being modified comp, Set<E> the Set already existing in the composite existing, Set<E> the Set being added to the composite added, Collection<E> the intersection of the existing and added sets intersects)Called when a Set is added to the CompositeSet and there is a collision between existing and added sets. |
| add | back to summary |
|---|---|
| public boolean add(CompositeSet<E> composite, List<Set<E>> sets, E obj) Called when an object is to be added to the composite.
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(CompositeSet<E> composite, List<Set<E>> sets, Collection<? extends E> coll) Called when a collection is to be added to the composite.
| |
| resolveCollision | back to summary |
|---|---|
| public void resolveCollision(CompositeSet<E> comp, Set<E> existing, Set<E> added, Collection<E> intersects) Called when a Set is added to the CompositeSet and there is a collision between existing and added sets.
If
| |