Class AbstractIntSet

  • All Implemented Interfaces:
    IntSet
    Direct Known Subclasses:
    IntArraySet, IntHashSet, IntRangeSet

    public abstract class AbstractIntSet
    extends java.lang.Object
    implements IntSet
    Abstract superclass containing helper methods for various implementations of IntSet
    • Constructor Detail

      • AbstractIntSet

        public AbstractIntSet()
    • Method Detail

      • containsAll

        public boolean containsAll​(IntSet other)
        Test if this set is a superset of another set
        Specified by:
        containsAll in interface IntSet
        Parameters:
        other - the other set
        Returns:
        true if every item in the other set is also in this set
      • union

        public IntSet union​(IntSet other)
        Form a new set that is the union of two IntSets.
        Specified by:
        union in interface IntSet
        Parameters:
        other - the second set
        Returns:
        the union of the two sets
      • intersect

        public IntSet intersect​(IntSet other)
        Form a new set that is the intersection of two IntSets.
        Specified by:
        intersect in interface IntSet
        Parameters:
        other - the second set
        Returns:
        the intersection of the two sets
      • except

        public IntSet except​(IntSet other)
        Form a new set that is the difference of this set and another set. The result will either be an immutable object, or a newly constructed object.
        Specified by:
        except in interface IntSet
        Parameters:
        other - the second set
        Returns:
        the intersection of the two sets