Package com.google.common.collect
Class TreeRangeSet.SubRangeSet
java.lang.Object
com.google.common.collect.AbstractRangeSet<C>
com.google.common.collect.TreeRangeSet<C>
com.google.common.collect.TreeRangeSet.SubRangeSet
- All Implemented Interfaces:
RangeSet<C>
,Serializable
- Enclosing class:
TreeRangeSet<C extends Comparable<?>>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.collect.TreeRangeSet
TreeRangeSet.AsRanges, TreeRangeSet.RangesByUpperBound<C extends Comparable<?>>
-
Field Summary
FieldsFields inherited from class com.google.common.collect.TreeRangeSet
rangesByLowerBound
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified range to thisRangeSet
(optional operation).void
clear()
Removes all ranges from thisRangeSet
(optional operation).boolean
Determines whether any of this range set's member ranges containsvalue
.boolean
Returnstrue
if there exists a member range in this range set which encloses the specified range.rangeContaining
(C value) Returns the unique range from this range set that containsvalue
, ornull
if this range set does not containvalue
.void
Removes the specified range from thisRangeSet
(optional operation).subRangeSet
(Range<C> view) Returns a view of the intersection of thisRangeSet
with the specified range.Methods inherited from class com.google.common.collect.TreeRangeSet
asDescendingSetOfRanges, asRanges, complement, create, create, create, intersects, span
Methods inherited from class com.google.common.collect.AbstractRangeSet
addAll, enclosesAll, equals, hashCode, isEmpty, removeAll, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.common.collect.RangeSet
addAll, enclosesAll, removeAll
-
Field Details
-
restriction
-
-
Constructor Details
-
SubRangeSet
-
-
Method Details
-
encloses
Description copied from interface:RangeSet
Returnstrue
if there exists a member range in this range set which encloses the specified range.- Specified by:
encloses
in interfaceRangeSet<C extends Comparable<?>>
- Overrides:
encloses
in classTreeRangeSet<C extends Comparable<?>>
-
rangeContaining
Description copied from interface:RangeSet
Returns the unique range from this range set that containsvalue
, ornull
if this range set does not containvalue
.- Specified by:
rangeContaining
in interfaceRangeSet<C extends Comparable<?>>
- Overrides:
rangeContaining
in classTreeRangeSet<C extends Comparable<?>>
-
add
Description copied from interface:RangeSet
Adds the specified range to thisRangeSet
(optional operation). That is, for equal range sets a and b, the result ofa.add(range)
is thata
will be the minimal range set for which botha.enclosesAll(b)
anda.encloses(range)
.Note that
range
will be coalesced with any ranges in the range set that are connected with it. Moreover, ifrange
is empty, this is a no-op.- Specified by:
add
in interfaceRangeSet<C extends Comparable<?>>
- Overrides:
add
in classTreeRangeSet<C extends Comparable<?>>
-
remove
Description copied from interface:RangeSet
Removes the specified range from thisRangeSet
(optional operation). After this operation, ifrange.contains(c)
,this.contains(c)
will returnfalse
.If
range
is empty, this is a no-op.- Specified by:
remove
in interfaceRangeSet<C extends Comparable<?>>
- Overrides:
remove
in classTreeRangeSet<C extends Comparable<?>>
-
contains
Description copied from interface:RangeSet
Determines whether any of this range set's member ranges containsvalue
.- Specified by:
contains
in interfaceRangeSet<C extends Comparable<?>>
- Overrides:
contains
in classAbstractRangeSet<C extends Comparable<?>>
-
clear
public void clear()Description copied from interface:RangeSet
Removes all ranges from thisRangeSet
(optional operation). After this operation,this.contains(c)
will return false for allc
.This is equivalent to
remove(Range.all())
.- Specified by:
clear
in interfaceRangeSet<C extends Comparable<?>>
- Overrides:
clear
in classAbstractRangeSet<C extends Comparable<?>>
-
subRangeSet
Description copied from interface:RangeSet
Returns a view of the intersection of thisRangeSet
with the specified range.The returned view supports all optional operations supported by this
RangeSet
, with the caveat that anIllegalArgumentException
is thrown on an attempt to add any range not enclosed byview
.- Specified by:
subRangeSet
in interfaceRangeSet<C extends Comparable<?>>
- Overrides:
subRangeSet
in classTreeRangeSet<C extends Comparable<?>>
-