org.apache.commons.collections.set
public class CompositeSet extends CompositeCollection implements Set
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.
Since: Commons Collections 3.0
Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
Nested Class Summary | |
---|---|
static interface | CompositeSet.SetMutator
Define callbacks for mutation operations.
|
Constructor Summary | |
---|---|
CompositeSet()
Create an empty CompositeSet | |
CompositeSet(Set set)
Create a CompositeSet with just set composited | |
CompositeSet(Set[] sets)
Create a composite set with sets as the initial set of composited Sets |
Method Summary | |
---|---|
void | addComposited(Collection c)
Add a Set to this composite
|
void | addComposited(Collection c, Collection d)
Add two sets to this composite
|
void | addComposited(Collection[] comps)
Add an array of sets to this composite |
boolean | equals(Object obj) |
int | hashCode() |
boolean | remove(Object obj)
If a CollectionMutator is defined for this CompositeSet then this
method will be called anyway.
|
void | setMutator(CollectionMutator mutator)
This can receive either a CompositeCollection.CollectionMutator
or a CompositeSet.SetMutator . |
set
compositedParameters: set The initial set in the composite
Parameters: c Must implement Set
Throws: IllegalArgumentException if c does not implement java.util.Set or if a SetMutator is set, but fails to resolve a collision UnsupportedOperationException if there is no SetMutator set, or a CollectionMutator is set instead of a SetMutator
See Also: CollectionMutator SetMutator
Throws: IllegalArgumentException if c or d does not implement java.util.Set
Parameters: comps
Throws: IllegalArgumentException if any of the collections in comps do not implement Set
See Also: Set#equals
See Also: Set#hashCode
CollectionMutator
is defined for this CompositeSet then this
method will be called anyway.
Parameters: obj Object to be removed
Returns: true if the object is removed, false otherwise
CompositeCollection.CollectionMutator
or a CompositeSet.SetMutator
. If a
CompositeCollection.CollectionMutator
is used than conflicts when adding
composited sets will throw IllegalArgumentException