Top Description Inners Fields Constructors Methods
com.google.common.collect

public Class TreeRangeSet<C extends java.lang.Comparable<?>>

extends AbstractRangeSet<C extends Comparable<?>>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
com.google.common.collect.TreeRangeSet.Complement, com.google.common.collect.TreeRangeSet.SubRangeSet
Annotations
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkArgument, .Preconditions.checkNotNull

An implementation of RangeSet backed by a TreeMap.
Author
Louis Wasserman
Since
14.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
private class
private static class
pack-priv static class
private class
private static class

Field Summary

Modifier and TypeField and Description
private transient Set<Range<C>>
private transient Set<Range<C>>
private transient RangeSet<C>
pack-priv final NavigableMap<Cut<C>, Range<C>>

Constructor Summary

AccessConstructor and Description
private
TreeRangeSet(NavigableMap<Cut<C>, Range<C>> rangesByLowerCut)

Method Summary

Modifier and TypeMethod and Description
public void
add(Range<C> rangeToAdd)

Overrides com.google.common.collect.AbstractRangeSet.add.

Implements com.google.common.collect.RangeSet.add.

Adds the specified range to this RangeSet (optional operation).
public Set<Range<C>>
asDescendingSetOfRanges()

Implements com.google.common.collect.RangeSet.asDescendingSetOfRanges.

Returns a descending view of the disconnected ranges that make up this range set.
public Set<Range<C>>
asRanges()

Implements com.google.common.collect.RangeSet.asRanges.

Returns a view of the disconnected ranges that make up this range set.
public RangeSet<C>
complement()

Implements com.google.common.collect.RangeSet.complement.

Returns a view of the complement of this RangeSet.
public static <C extends Comparable<?>> TreeRangeSet<C>
create()

Creates an empty TreeRangeSet instance.

public static <C extends Comparable<?>> TreeRangeSet<C>
create(RangeSet<C> rangeSet)

Returns a TreeRangeSet initialized with the ranges in the specified range set.

public static <C extends Comparable<?>> TreeRangeSet<C>
create(Iterable<Range<C>> ranges)

Returns a TreeRangeSet representing the union of the specified ranges.

public boolean
encloses(Range<C> range)

Implements abstract com.google.common.collect.AbstractRangeSet.encloses.

Implements com.google.common.collect.RangeSet.encloses.

Returns true if there exists a member range in this range set which encloses the specified range.
public boolean
intersects(Range<C> range)

Overrides com.google.common.collect.AbstractRangeSet.intersects.

Implements com.google.common.collect.RangeSet.intersects.

Returns true if there exists a non-empty range enclosed by both a member range in this range set and the specified range.
public Range<C>
rangeContaining(C value)

Implements abstract com.google.common.collect.AbstractRangeSet.rangeContaining.

Implements com.google.common.collect.RangeSet.rangeContaining.

Returns the unique range from this range set that contains value, or null if this range set does not contain value.
private Range<C>
public void
remove(Range<C> rangeToRemove)

Overrides com.google.common.collect.AbstractRangeSet.remove.

Implements com.google.common.collect.RangeSet.remove.

Removes the specified range from this RangeSet (optional operation).
private void
public Range<C>
span()

Implements com.google.common.collect.RangeSet.span.

Returns the minimal range which encloses all ranges in this range set.
public RangeSet<C>
subRangeSet(Range<C> view)

Implements com.google.common.collect.RangeSet.subRangeSet.

Returns a view of the intersection of this RangeSet with the specified range.
Inherited from com.google.common.collect.AbstractRangeSet:
addAllclearcontainsenclosesAllequalshashCodeisEmptyremoveAlltoString