Interface CompositeSet.SetMutator<E>

  • All Superinterfaces:
    java.io.Serializable
    Enclosing class:
    CompositeSet<E>

    public static interface CompositeSet.SetMutator<E>
    extends java.io.Serializable
    Define callbacks for mutation operations.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean add​(CompositeSet<E> composite, java.util.List<java.util.Set<E>> sets, E obj)
      Called when an object is to be added to the composite.
      boolean addAll​(CompositeSet<E> composite, java.util.List<java.util.Set<E>> sets, java.util.Collection<? extends E> coll)
      Called when a collection is to be added to the composite.
      void resolveCollision​(CompositeSet<E> comp, java.util.Set<E> existing, java.util.Set<E> added, java.util.Collection<E> intersects)
      Called when a Set is added to the CompositeSet and there is a collision between existing and added sets.
    • Method Detail

      • add

        boolean add​(CompositeSet<E> composite,
                    java.util.List<java.util.Set<E>> sets,
                    E obj)
        Called when an object is to be added to the composite.
        Parameters:
        composite - the CompositeSet being changed
        sets - all of the Set instances in this CompositeSet
        obj - the object being added
        Returns:
        true if the collection is changed
        Throws:
        java.lang.UnsupportedOperationException - if add is unsupported
        java.lang.ClassCastException - if the object cannot be added due to its type
        java.lang.NullPointerException - if the object cannot be added because its null
        java.lang.IllegalArgumentException - if the object cannot be added
      • addAll

        boolean addAll​(CompositeSet<E> composite,
                       java.util.List<java.util.Set<E>> sets,
                       java.util.Collection<? extends E> coll)
        Called when a collection is to be added to the composite.
        Parameters:
        composite - the CompositeSet being changed
        sets - all of the Set instances in this CompositeSet
        coll - the collection being added
        Returns:
        true if the collection is changed
        Throws:
        java.lang.UnsupportedOperationException - if add is unsupported
        java.lang.ClassCastException - if the object cannot be added due to its type
        java.lang.NullPointerException - if the object cannot be added because its null
        java.lang.IllegalArgumentException - if the object cannot be added
      • resolveCollision

        void resolveCollision​(CompositeSet<E> comp,
                              java.util.Set<E> existing,
                              java.util.Set<E> added,
                              java.util.Collection<E> intersects)
        Called when a Set is added to the CompositeSet and there is a collision between existing and added sets.

        If added and existing still have any intersects after this method returns an IllegalArgumentException will be thrown.

        Parameters:
        comp - the CompositeSet being modified
        existing - the Set already existing in the composite
        added - the Set being added to the composite
        intersects - the intersection of the existing and added sets