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>,java.io.Serializable
- Enclosing class:
- TreeRangeSet<C extends java.lang.Comparable<?>>
private final class TreeRangeSet.SubRangeSet extends TreeRangeSet<C>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.TreeRangeSet
TreeRangeSet.AsRanges, TreeRangeSet.RangesByUpperBound<C extends java.lang.Comparable<?>>
-
-
Field Summary
Fields Modifier and Type Field Description private Range<C>restriction-
Fields inherited from class com.google.common.collect.TreeRangeSet
rangesByLowerBound
-
-
Constructor Summary
Constructors Constructor Description SubRangeSet(Range<C> restriction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Range<C> rangeToAdd)Adds the specified range to thisRangeSet(optional operation).voidclear()Removes all ranges from thisRangeSet(optional operation).booleancontains(C value)Determines whether any of this range set's member ranges containsvalue.booleanencloses(Range<C> range)Returnstrueif there exists a member range in this range set which encloses the specified range.Range<C>rangeContaining(C value)Returns the unique range from this range set that containsvalue, ornullif this range set does not containvalue.voidremove(Range<C> rangeToRemove)Removes the specified range from thisRangeSet(optional operation).RangeSet<C>subRangeSet(Range<C> view)Returns a view of the intersection of thisRangeSetwith 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
-
-
-
-
Method Detail
-
encloses
public boolean encloses(Range<C> range)
Description copied from interface:RangeSetReturnstrueif there exists a member range in this range set which encloses the specified range.
-
rangeContaining
public Range<C> rangeContaining(C value)
Description copied from interface:RangeSetReturns the unique range from this range set that containsvalue, ornullif this range set does not containvalue.- Specified by:
rangeContainingin interfaceRangeSet<C extends java.lang.Comparable<?>>- Overrides:
rangeContainingin classTreeRangeSet<C extends java.lang.Comparable<?>>
-
add
public void add(Range<C> rangeToAdd)
Description copied from interface:RangeSetAdds the specified range to thisRangeSet(optional operation). That is, for equal range sets a and b, the result ofa.add(range)is thatawill be the minimal range set for which botha.enclosesAll(b)anda.encloses(range).Note that
rangewill be coalesced with any ranges in the range set that are connected with it. Moreover, ifrangeis empty, this is a no-op.
-
remove
public void remove(Range<C> rangeToRemove)
Description copied from interface:RangeSetRemoves the specified range from thisRangeSet(optional operation). After this operation, ifrange.contains(c),this.contains(c)will returnfalse.If
rangeis empty, this is a no-op.
-
contains
public boolean contains(C value)
Description copied from interface:RangeSetDetermines whether any of this range set's member ranges containsvalue.
-
clear
public void clear()
Description copied from interface:RangeSetRemoves all ranges from thisRangeSet(optional operation). After this operation,this.contains(c)will return false for allc.This is equivalent to
remove(Range.all()).
-
subRangeSet
public RangeSet<C> subRangeSet(Range<C> view)
Description copied from interface:RangeSetReturns a view of the intersection of thisRangeSetwith the specified range.The returned view supports all optional operations supported by this
RangeSet, with the caveat that anIllegalArgumentExceptionis thrown on an attempt to add any range not enclosed byview.- Specified by:
subRangeSetin interfaceRangeSet<C extends java.lang.Comparable<?>>- Overrides:
subRangeSetin classTreeRangeSet<C extends java.lang.Comparable<?>>
-
-