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

public final Class ImmutableRangeSet<C extends Comparable<T>>

extends AbstractRangeSet<C extends Comparable<T>>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@SuppressWarnings:rawtypes
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkArgument, .Preconditions.checkElementIndex, .Preconditions.checkNotNull, com.google.common.collect.SortedLists.KeyAbsentBehavior.NEXT_HIGHER, .SortedLists.KeyAbsentBehavior.NEXT_LOWER, .SortedLists.KeyPresentBehavior.ANY_PRESENT, java.util.Objects.requireNonNull

A RangeSet whose contents will never change, with many other important properties detailed at ImmutableCollection.
Author
Louis Wasserman
Since
14.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
public static class
ImmutableRangeSet.Builder<C extends Comparable<?>>

A builder for immutable range sets.

private class
private static class

Field Summary

Modifier and TypeField and Description
private static final ImmutableRangeSet<Comparable<?>>
private transient ImmutableRangeSet<C>
private static final ImmutableRangeSet<Comparable<?>>
private final transient ImmutableList<Range<C>>

Constructor Summary

AccessConstructor and Description
pack-priv
private

Method Summary

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

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

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

Deprecated Unsupported operation.
Guaranteed to throw an exception and leave the RangeSet unmodified.
public void
addAll(RangeSet<C> other)

Overrides com.google.common.collect.AbstractRangeSet.addAll.

Implements com.google.common.collect.RangeSet.addAll.

Deprecated Unsupported operation.
Guaranteed to throw an exception and leave the RangeSet unmodified.
public void
addAll(Iterable<Range<C>> other)

Overrides default com.google.common.collect.RangeSet.addAll.

Deprecated Unsupported operation.
Guaranteed to throw an exception and leave the RangeSet unmodified.
pack-priv static <C extends Comparable<T>> ImmutableRangeSet<C>
all()

Returns an immutable range set containing the single range Range#all().

public ImmutableSet<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 ImmutableSet<Range<C>>
asRanges()

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

Returns a view of the disconnected ranges that make up this range set.
public ImmutableSortedSet<C>
asSet(DiscreteDomain<C> domain)

Returns an ImmutableSortedSet containing the same values in the given domain contained by this range set.

public static <C extends Comparable<?>> ImmutableRangeSet.Builder<C>
builder()

Returns a new builder for an immutable range set.

public ImmutableRangeSet<C>
complement()

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

Returns a view of the complement of this RangeSet.
public static <C extends Comparable<T>> ImmutableRangeSet<C>
copyOf(RangeSet<C> rangeSet)

Returns an immutable copy of the specified RangeSet.

public static <C extends Comparable<?>> ImmutableRangeSet<C>
copyOf(Iterable<Range<C>> ranges)

Returns an ImmutableRangeSet containing each of the specified disjoint ranges.

public ImmutableRangeSet<C>
difference(RangeSet<C> other)

Returns a new range set consisting of the difference of this range set and other.

public boolean
encloses(Range<C> otherRange)

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 ImmutableRangeSet<C>
intersection(RangeSet<C> other)

Returns a new range set consisting of the intersection of this range set and other.

private ImmutableList<Range<C>>
intersectRanges(final Range<C> range)

Returns a list containing the nonempty intersections of range with the ranges in this range set.

public boolean
intersects(Range<C> otherRange)

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 boolean
isEmpty()

Overrides com.google.common.collect.AbstractRangeSet.isEmpty.

Implements com.google.common.collect.RangeSet.isEmpty.

Returns true if this range set contains no ranges.
pack-priv boolean
isPartialView()

Returns true if this immutable range set's implementation contains references to user-created objects that aren't accessible via this range set's methods.

public static <C extends Comparable<T>> ImmutableRangeSet<C>
of()

Returns an empty immutable range set.

public static <C extends Comparable<T>> ImmutableRangeSet<C>
of(Range<C> range)

Returns an immutable range set containing the specified single 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 void
public void
remove(Range<C> range)

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

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

Deprecated Unsupported operation.
Guaranteed to throw an exception and leave the RangeSet unmodified.
public void
removeAll(RangeSet<C> other)

Overrides com.google.common.collect.AbstractRangeSet.removeAll.

Implements com.google.common.collect.RangeSet.removeAll.

Deprecated Unsupported operation.
Guaranteed to throw an exception and leave the RangeSet unmodified.
public void
removeAll(Iterable<Range<C>> other)

Overrides default com.google.common.collect.RangeSet.removeAll.

Deprecated Unsupported operation.
Guaranteed to throw an exception and leave the RangeSet unmodified.
public Range<C>
span()

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

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

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

Returns a view of the intersection of this range set with the given range.
public static <E extends Comparable<? super E>> Collector<Range<E>, ?, ImmutableRangeSet<E>>
toImmutableRangeSet()

Returns a Collector that accumulates the input elements into a new ImmutableRangeSet.

public ImmutableRangeSet<C>
union(RangeSet<C> other)

Returns a new range set consisting of the union of this range set and other.

public static <C extends Comparable<?>> ImmutableRangeSet<C>
unionOf(Iterable<Range<C>> ranges)

Returns an ImmutableRangeSet representing the union of the specified ranges.

pack-priv Object
Inherited from com.google.common.collect.AbstractRangeSet:
clearcontainsenclosesAllequalshashCodetoString