Class CompositeSet
- java.lang.Object
-
- org.apache.commons.collections.collection.CompositeCollection
-
- org.apache.commons.collections.set.CompositeSet
-
- All Implemented Interfaces:
Iterable,Collection,Set
@Deprecated(since="2021-04-30") public class CompositeSet extends CompositeCollection implements Set
Deprecated.Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.Decorates a set of other sets to provide a single unified view.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCompositeSet.SetMutatorDeprecated.Commons Collections 3 is in maintenance mode.-
Nested classes/interfaces inherited from class org.apache.commons.collections.collection.CompositeCollection
CompositeCollection.CollectionMutator
-
-
Constructor Summary
Constructors Constructor Description CompositeSet()Deprecated.Create an empty CompositeSetCompositeSet(Set set)Deprecated.Create a CompositeSet with justsetcompositedCompositeSet(Set[] sets)Deprecated.Create a composite set with sets as the initial set of composited Sets
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddComposited(Collection c)Deprecated.Add a Set to this compositevoidaddComposited(Collection[] comps)Deprecated.Add an array of sets to this compositevoidaddComposited(Collection c, Collection d)Deprecated.Add two sets to this compositebooleanequals(Object obj)Deprecated.inthashCode()Deprecated.booleanremove(Object obj)Deprecated.If aCollectionMutatoris defined for this CompositeSet then this method will be called anyway.voidsetMutator(CompositeCollection.CollectionMutator mutator)Deprecated.This can receive either aCompositeCollection.CollectionMutatoror aCompositeSet.SetMutator.-
Methods inherited from class org.apache.commons.collections.collection.CompositeCollection
add, addAll, clear, contains, containsAll, getCollections, isEmpty, iterator, removeAll, removeComposited, retainAll, size, toArray, toArray, toCollection
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Constructor Detail
-
CompositeSet
public CompositeSet()
Deprecated.Create an empty CompositeSet
-
CompositeSet
public CompositeSet(Set set)
Deprecated.Create a CompositeSet with justsetcomposited- Parameters:
set- The initial set in the composite
-
CompositeSet
public CompositeSet(Set[] sets)
Deprecated.Create a composite set with sets as the initial set of composited Sets
-
-
Method Detail
-
addComposited
public void addComposited(Collection c)
Deprecated.Add a Set to this composite- Overrides:
addCompositedin classCompositeCollection- 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 collisionUnsupportedOperationException- if there is no SetMutator set, or a CollectionMutator is set instead of a SetMutator- See Also:
CompositeCollection.CollectionMutator,CompositeSet.SetMutator
-
addComposited
public void addComposited(Collection c, Collection d)
Deprecated.Add two sets to this composite- Overrides:
addCompositedin classCompositeCollection- Parameters:
c- the first collection to addd- the second collection to add- Throws:
IllegalArgumentException- if c or d does not implement java.util.Set
-
addComposited
public void addComposited(Collection[] comps)
Deprecated.Add an array of sets to this composite- Overrides:
addCompositedin classCompositeCollection- Parameters:
comps-- Throws:
IllegalArgumentException- if any of the collections in comps do not implement Set
-
setMutator
public void setMutator(CompositeCollection.CollectionMutator mutator)
Deprecated.This can receive either aCompositeCollection.CollectionMutatoror aCompositeSet.SetMutator. If aCompositeCollection.CollectionMutatoris used than conflicts when adding composited sets will throw IllegalArgumentException- Overrides:
setMutatorin classCompositeCollection- Parameters:
mutator- the mutator to use
-
remove
public boolean remove(Object obj)
Deprecated.If aCollectionMutatoris defined for this CompositeSet then this method will be called anyway.- Specified by:
removein interfaceCollection- Specified by:
removein interfaceSet- Overrides:
removein classCompositeCollection- Parameters:
obj- Object to be removed- Returns:
- true if the object is removed, false otherwise
-
equals
public boolean equals(Object obj)
Deprecated.- Specified by:
equalsin interfaceCollection- Specified by:
equalsin interfaceSet- Overrides:
equalsin classObject- See Also:
Set.equals(java.lang.Object)
-
hashCode
public int hashCode()
Deprecated.- Specified by:
hashCodein interfaceCollection- Specified by:
hashCodein interfaceSet- Overrides:
hashCodein classObject- See Also:
Set.hashCode()
-
-