Class TreeRangeSet.SubRangeSet

All Implemented Interfaces:
RangeSet<C>, Serializable
Enclosing class:
TreeRangeSet<C extends Comparable<?>>

private final class TreeRangeSet.SubRangeSet extends TreeRangeSet<C>
  • Field Details

  • Constructor Details

    • SubRangeSet

      SubRangeSet(Range<C> restriction)
  • Method Details

    • encloses

      public boolean encloses(Range<C> range)
      Description copied from interface: RangeSet
      Returns true if there exists a member range in this range set which encloses the specified range.
      Specified by:
      encloses in interface RangeSet<C extends Comparable<?>>
      Overrides:
      encloses in class TreeRangeSet<C extends Comparable<?>>
    • rangeContaining

      @CheckForNull public Range<C> rangeContaining(C value)
      Description copied from interface: RangeSet
      Returns the unique range from this range set that contains value, or null if this range set does not contain value.
      Specified by:
      rangeContaining in interface RangeSet<C extends Comparable<?>>
      Overrides:
      rangeContaining in class TreeRangeSet<C extends Comparable<?>>
    • add

      public void add(Range<C> rangeToAdd)
      Description copied from interface: RangeSet
      Adds the specified range to this RangeSet (optional operation). That is, for equal range sets a and b, the result of a.add(range) is that a will be the minimal range set for which both a.enclosesAll(b) and a.encloses(range).

      Note that range will be coalesced with any ranges in the range set that are connected with it. Moreover, if range is empty, this is a no-op.

      Specified by:
      add in interface RangeSet<C extends Comparable<?>>
      Overrides:
      add in class TreeRangeSet<C extends Comparable<?>>
    • remove

      public void remove(Range<C> rangeToRemove)
      Description copied from interface: RangeSet
      Removes the specified range from this RangeSet (optional operation). After this operation, if range.contains(c), this.contains(c) will return false.

      If range is empty, this is a no-op.

      Specified by:
      remove in interface RangeSet<C extends Comparable<?>>
      Overrides:
      remove in class TreeRangeSet<C extends Comparable<?>>
    • contains

      public boolean contains(C value)
      Description copied from interface: RangeSet
      Determines whether any of this range set's member ranges contains value.
      Specified by:
      contains in interface RangeSet<C extends Comparable<?>>
      Overrides:
      contains in class AbstractRangeSet<C extends Comparable<?>>
    • clear

      public void clear()
      Description copied from interface: RangeSet
      Removes all ranges from this RangeSet (optional operation). After this operation, this.contains(c) will return false for all c.

      This is equivalent to remove(Range.all()).

      Specified by:
      clear in interface RangeSet<C extends Comparable<?>>
      Overrides:
      clear in class AbstractRangeSet<C extends Comparable<?>>
    • subRangeSet

      public RangeSet<C> subRangeSet(Range<C> view)
      Description copied from interface: RangeSet
      Returns a view of the intersection of this RangeSet with the specified range.

      The returned view supports all optional operations supported by this RangeSet, with the caveat that an IllegalArgumentException is thrown on an attempt to add any range not enclosed by view.

      Specified by:
      subRangeSet in interface RangeSet<C extends Comparable<?>>
      Overrides:
      subRangeSet in class TreeRangeSet<C extends Comparable<?>>