private final class TreeRangeSet.Complement extends TreeRangeSet<C>
TreeRangeSet.AsRanges, TreeRangeSet.RangesByUpperBound<C extends java.lang.Comparable<?>>
rangesByLowerBound
Constructor and Description |
---|
Complement() |
Modifier and Type | Method and Description |
---|---|
void |
add(Range<C> rangeToAdd)
Adds the specified range to this
RangeSet (optional operation). |
RangeSet<C> |
complement()
Returns a view of the complement of this
RangeSet . |
boolean |
contains(C value)
Determines whether any of this range set's member ranges contains
value . |
void |
remove(Range<C> rangeToRemove)
Removes the specified range from this
RangeSet (optional operation). |
asRanges, create, create, encloses, rangeContaining, span, subRangeSet
addAll, clear, enclosesAll, equals, hashCode, isEmpty, removeAll, toString
public void add(Range<C> rangeToAdd)
RangeSet
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.
public void remove(Range<C> rangeToRemove)
RangeSet
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.
public boolean contains(C value)
RangeSet
value
.public RangeSet<C> complement()
RangeSet
RangeSet
.
The returned view supports the RangeSet.add(com.google.common.collect.Range<C>)
operation if this RangeSet
supports
RangeSet.remove(com.google.common.collect.Range<C>)
, and vice versa.
complement
in interface RangeSet<C extends java.lang.Comparable<?>>
complement
in class TreeRangeSet<C extends java.lang.Comparable<?>>