Class CompositeSet

  • All Implemented Interfaces:
    java.lang.Iterable, java.util.Collection, java.util.Set

    @Deprecated(since="2021-04-30")
    public class CompositeSet
    extends CompositeCollection
    implements java.util.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
    • Constructor Summary

      Constructors 
      Constructor Description
      CompositeSet()
      Deprecated.
      Create an empty CompositeSet
      CompositeSet​(java.util.Set set)
      Deprecated.
      Create a CompositeSet with just set composited
      CompositeSet​(java.util.Set[] sets)
      Deprecated.
      Create a composite set with sets as the initial set of composited Sets
    • Constructor Detail

      • CompositeSet

        public CompositeSet()
        Deprecated.
        Create an empty CompositeSet
      • CompositeSet

        public CompositeSet​(java.util.Set set)
        Deprecated.
        Create a CompositeSet with just set composited
        Parameters:
        set - The initial set in the composite
      • CompositeSet

        public CompositeSet​(java.util.Set[] sets)
        Deprecated.
        Create a composite set with sets as the initial set of composited Sets
    • Method Detail

      • addComposited

        public void addComposited​(java.util.Collection c)
        Deprecated.
        Add a Set to this composite
        Overrides:
        addComposited in class CompositeCollection
        Parameters:
        c - Must implement Set
        Throws:
        java.lang.IllegalArgumentException - if c does not implement java.util.Set or if a SetMutator is set, but fails to resolve a collision
        java.lang.UnsupportedOperationException - 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​(java.util.Collection c,
                                  java.util.Collection d)
        Deprecated.
        Add two sets to this composite
        Overrides:
        addComposited in class CompositeCollection
        Parameters:
        c - the first collection to add
        d - the second collection to add
        Throws:
        java.lang.IllegalArgumentException - if c or d does not implement java.util.Set
      • addComposited

        public void addComposited​(java.util.Collection[] comps)
        Deprecated.
        Add an array of sets to this composite
        Overrides:
        addComposited in class CompositeCollection
        Parameters:
        comps -
        Throws:
        java.lang.IllegalArgumentException - if any of the collections in comps do not implement Set
      • setMutator

        public void setMutator​(CompositeCollection.CollectionMutator mutator)
        Deprecated.
        This can receive either a CompositeCollection.CollectionMutator or a CompositeSet.SetMutator. If a CompositeCollection.CollectionMutator is used than conflicts when adding composited sets will throw IllegalArgumentException

        Overrides:
        setMutator in class CompositeCollection
        Parameters:
        mutator - the mutator to use
      • remove

        public boolean remove​(java.lang.Object obj)
        Deprecated.
        If a CollectionMutator is defined for this CompositeSet then this method will be called anyway.
        Specified by:
        remove in interface java.util.Collection
        Specified by:
        remove in interface java.util.Set
        Overrides:
        remove in class CompositeCollection
        Parameters:
        obj - Object to be removed
        Returns:
        true if the object is removed, false otherwise
      • equals

        public boolean equals​(java.lang.Object obj)
        Deprecated.
        Specified by:
        equals in interface java.util.Collection
        Specified by:
        equals in interface java.util.Set
        Overrides:
        equals in class java.lang.Object
        See Also:
        Set.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Deprecated.
        Specified by:
        hashCode in interface java.util.Collection
        Specified by:
        hashCode in interface java.util.Set
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Set.hashCode()