Class AbstractSetEx<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
pascal.taie.util.collection.AbstractSetEx<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, SetEx<E>, Copyable<SetEx<E>>
Direct Known Subclasses:
AbstractHybridSet, ArraySet, GenericBitSet, IndexableSet

public abstract class AbstractSetEx<E> extends AbstractSet<E> implements SetEx<E>
  • Constructor Details

    • AbstractSetEx

      public AbstractSetEx()
  • Method Details

    • copy

      public SetEx<E> copy()
      Description copied from interface: Copyable
      Creates and returns a copy of this object.
      Specified by:
      copy in interface Copyable<E>
      Returns:
      a copy of this object.
    • addAllDiff

      public SetEx<E> addAllDiff(Collection<? extends E> c)
      Description copied from interface: SetEx
      Adds all elements in collection c, and returns the difference set between c and this set (before the call).
      Specified by:
      addAllDiff in interface SetEx<E>
      Returns:
      a set of elements that are contained in c but not in this set before the call.
    • newSet

      protected SetEx<E> newSet()
      Creates and returns a new set. The type of the new set should be the corresponding subclass. This method is provided to ease the implementation of copy() and addAllDiff(Collection). If a subclass overwrites above two methods, it does not need to re-implement this method.
    • hasOverlapWith

      public boolean hasOverlapWith(Set<E> other)
      Specified by:
      hasOverlapWith in interface SetEx<E>
      Returns:
      true if this set has at least one element contained in the given set.