Uses of Class
com.google.common.collect.Range
-
Packages that use Range Package Description com.google.common.collect Collection interfaces and implementations, and other utilities for collections. -
-
Uses of Range in com.google.common.collect
Methods in com.google.common.collect that return Range Modifier and Type Method Description static <C extends Comparable<?>>
Range<C>Range. all()
Returns a range that contains every value of typeC
.static <C extends Comparable<?>>
Range<C>Range. atLeast(C endpoint)
Returns a range that contains all values greater than or equal toendpoint
.static <C extends Comparable<?>>
Range<C>Range. atMost(C endpoint)
Returns a range that contains all values less than or equal toendpoint
.Range<C>
Range. canonical(DiscreteDomain<C> domain)
Returns the canonical form of this range in the given domain.static <C extends Comparable<?>>
Range<C>Range. closed(C lower, C upper)
Returns a range that contains all values greater than or equal tolower
and less than or equal toupper
.static <C extends Comparable<?>>
Range<C>Range. closedOpen(C lower, C upper)
Returns a range that contains all values greater than or equal tolower
and strictly less thanupper
.static <C extends Comparable<?>>
Range<C>Range. downTo(C endpoint, BoundType boundType)
Returns a range from the given endpoint, which may be either inclusive (closed) or exclusive (open), with no upper bound.static <C extends Comparable<?>>
Range<C>Range. encloseAll(Iterable<C> values)
Returns the minimal range that contains all of the given values.Range<C>
Range. gap(Range<C> otherRange)
Returns the maximal range lying between this range andotherRange
, if such a range exists.static <C extends Comparable<?>>
Range<C>Range. greaterThan(C endpoint)
Returns a range that contains all values strictly greater thanendpoint
.Range<C>
Range. intersection(Range<C> connectedRange)
Returns the maximal range enclosed by both this range andconnectedRange
, if such a range exists.static <C extends Comparable<?>>
Range<C>Range. lessThan(C endpoint)
Returns a range that contains all values strictly less thanendpoint
.static <C extends Comparable<?>>
Range<C>Range. open(C lower, C upper)
Returns a range that contains all values strictly greater thanlower
and strictly less thanupper
.static <C extends Comparable<?>>
Range<C>Range. openClosed(C lower, C upper)
Returns a range that contains all values strictly greater thanlower
and less than or equal toupper
.abstract Range<C>
ContiguousSet. range()
Returns a range, closed on both ends, whose endpoints are the minimum and maximum values contained in this set.abstract Range<C>
ContiguousSet. range(BoundType lowerBoundType, BoundType upperBoundType)
Returns the minimal range with the given boundary types for which all values in this set are contained within the range.static <C extends Comparable<?>>
Range<C>Range. range(C lower, BoundType lowerType, C upper, BoundType upperType)
Returns a range that contains any value fromlower
toupper
, where each endpoint may be either inclusive (closed) or exclusive (open).Range<C>
ImmutableRangeSet. rangeContaining(C value)
Range<C>
RangeSet. rangeContaining(C value)
Returns the unique range from this range set that containsvalue
, ornull
if this range set does not containvalue
.Range<C>
TreeRangeSet. rangeContaining(C value)
static <C extends Comparable<?>>
Range<C>Range. singleton(C value)
Returns a range that contains only the given value.Range<K>
ImmutableRangeMap. span()
Range<C>
ImmutableRangeSet. span()
Range<C>
Range. span(Range<C> other)
Returns the minimal range that encloses both this range andother
.Range<K>
RangeMap. span()
Returns the minimal range enclosing the ranges in thisRangeMap
.Range<C>
RangeSet. span()
Returns the minimal range which encloses all ranges in this range set.Range<K>
TreeRangeMap. span()
Range<C>
TreeRangeSet. span()
static <C extends Comparable<?>>
Range<C>Range. upTo(C endpoint, BoundType boundType)
Returns a range with no lower bound up to the given endpoint, which may be either inclusive (closed) or exclusive (open).Methods in com.google.common.collect that return types with arguments of type Range Modifier and Type Method Description ImmutableMap<Range<K>,V>
ImmutableRangeMap. asDescendingMapOfRanges()
Map<Range<K>,V>
RangeMap. asDescendingMapOfRanges()
Returns a view of this range map as an unmodifiableMap<Range<K>, V>
.Map<Range<K>,V>
TreeRangeMap. asDescendingMapOfRanges()
ImmutableSet<Range<C>>
ImmutableRangeSet. asDescendingSetOfRanges()
Set<Range<C>>
RangeSet. asDescendingSetOfRanges()
Returns a descending view of the disconnected ranges that make up this range set.Set<Range<C>>
TreeRangeSet. asDescendingSetOfRanges()
ImmutableMap<Range<K>,V>
ImmutableRangeMap. asMapOfRanges()
Map<Range<K>,V>
RangeMap. asMapOfRanges()
Returns a view of this range map as an unmodifiableMap<Range<K>, V>
.Map<Range<K>,V>
TreeRangeMap. asMapOfRanges()
ImmutableSet<Range<C>>
ImmutableRangeSet. asRanges()
Set<Range<C>>
RangeSet. asRanges()
Returns a view of the disconnected ranges that make up this range set.Set<Range<C>>
TreeRangeSet. asRanges()
Map.Entry<Range<K>,V>
ImmutableRangeMap. getEntry(K key)
Map.Entry<Range<K>,V>
RangeMap. getEntry(K key)
Returns the range containing this key and its associated value, if such a range is present in the range map, ornull
otherwise.Map.Entry<Range<K>,V>
TreeRangeMap. getEntry(K key)
static <E extends Comparable<? super E>>
Collector<Range<E>,?,ImmutableRangeSet<E>>ImmutableRangeSet. toImmutableRangeSet()
Returns aCollector
that accumulates the input elements into a newImmutableRangeSet
.Methods in com.google.common.collect with parameters of type Range Modifier and Type Method Description void
ImmutableRangeSet. add(Range<C> range)
Deprecated.Unsupported operation.ImmutableRangeSet.Builder<C>
ImmutableRangeSet.Builder. add(Range<C> range)
Add the specified range to this builder.void
RangeSet. add(Range<C> range)
Adds the specified range to thisRangeSet
(optional operation).void
TreeRangeSet. add(Range<C> rangeToAdd)
static <C extends Comparable>
ContiguousSet<C>ContiguousSet. create(Range<C> range, DiscreteDomain<C> domain)
Returns aContiguousSet
containing the same values in the given domain contained by the range.boolean
ImmutableRangeSet. encloses(Range<C> otherRange)
boolean
Range. encloses(Range<C> other)
Returnstrue
if the bounds ofother
do not extend outside the bounds of this range.boolean
RangeSet. encloses(Range<C> otherRange)
Returnstrue
if there exists a member range in this range set which encloses the specified range.boolean
TreeRangeSet. encloses(Range<C> range)
Range<C>
Range. gap(Range<C> otherRange)
Returns the maximal range lying between this range andotherRange
, if such a range exists.Range<C>
Range. intersection(Range<C> connectedRange)
Returns the maximal range enclosed by both this range andconnectedRange
, if such a range exists.boolean
ImmutableRangeSet. intersects(Range<C> otherRange)
boolean
RangeSet. intersects(Range<C> otherRange)
Returnstrue
if there exists a non-empty range enclosed by both a member range in this range set and the specified range.boolean
TreeRangeSet. intersects(Range<C> range)
boolean
Range. isConnected(Range<C> other)
Returnstrue
if there exists a (possibly empty) range which is enclosed by both this range andother
.static <K extends Comparable<?>,V>
ImmutableRangeMap<K,V>ImmutableRangeMap. of(Range<K> range, V value)
Returns an immutable range map mapping a single range to a single value.static <C extends Comparable>
ImmutableRangeSet<C>ImmutableRangeSet. of(Range<C> range)
Returns an immutable range set containing the specified single range.ImmutableRangeMap.Builder<K,V>
ImmutableRangeMap.Builder. put(Range<K> range, V value)
Associates the specified range with the specified value.void
ImmutableRangeMap. put(Range<K> range, V value)
Deprecated.Unsupported operation.void
RangeMap. put(Range<K> range, V value)
Maps a range to a specified value (optional operation).void
TreeRangeMap. put(Range<K> range, V value)
void
ImmutableRangeMap. putCoalescing(Range<K> range, V value)
Deprecated.Unsupported operation.void
RangeMap. putCoalescing(Range<K> range, V value)
Maps a range to a specified value, coalescing this range with any existing ranges with the same value that are connected to this range.void
TreeRangeMap. putCoalescing(Range<K> range, V value)
void
ImmutableRangeMap. remove(Range<K> range)
Deprecated.Unsupported operation.void
ImmutableRangeSet. remove(Range<C> range)
Deprecated.Unsupported operation.void
RangeMap. remove(Range<K> range)
Removes all associations from this range map in the specified range (optional operation).void
RangeSet. remove(Range<C> range)
Removes the specified range from thisRangeSet
(optional operation).void
TreeRangeMap. remove(Range<K> rangeToRemove)
void
TreeRangeSet. remove(Range<C> rangeToRemove)
Range<C>
Range. span(Range<C> other)
Returns the minimal range that encloses both this range andother
.static <K extends Comparable<? super K>,V extends @Nullable Object>
NavigableMap<K,V>Maps. subMap(NavigableMap<K,V> map, Range<K> range)
Returns a view of the portion ofmap
whose keys are contained byrange
.ImmutableRangeMap<K,V>
ImmutableRangeMap. subRangeMap(Range<K> range)
RangeMap<K,V>
RangeMap. subRangeMap(Range<K> range)
Returns a view of the part of this range map that intersects withrange
.RangeMap<K,V>
TreeRangeMap. subRangeMap(Range<K> subRange)
ImmutableRangeSet<C>
ImmutableRangeSet. subRangeSet(Range<C> range)
Returns a view of the intersection of this range set with the given range.RangeSet<C>
RangeSet. subRangeSet(Range<C> view)
Returns a view of the intersection of thisRangeSet
with the specified range.RangeSet<C>
TreeRangeSet. subRangeSet(Range<C> view)
static <K extends Comparable<? super K>>
NavigableSet<K>Sets. subSet(NavigableSet<K> set, Range<K> range)
Returns a view of the portion ofset
whose elements are contained byrange
.Method parameters in com.google.common.collect with type arguments of type Range Modifier and Type Method Description void
ImmutableRangeSet. addAll(Iterable<Range<C>> other)
Deprecated.Unsupported operation.ImmutableRangeSet.Builder<C>
ImmutableRangeSet.Builder. addAll(Iterable<Range<C>> ranges)
Add all of the specified ranges to this builder.void
RangeSet. addAll(Iterable<Range<C>> ranges)
Adds all of the specified ranges to this range set (optional operation).static <C extends Comparable<?>>
ImmutableRangeSet<C>ImmutableRangeSet. copyOf(Iterable<Range<C>> ranges)
Returns anImmutableRangeSet
containing each of the specified disjoint ranges.static <C extends Comparable<?>>
TreeRangeSet<C>TreeRangeSet. create(Iterable<Range<C>> ranges)
Returns aTreeRangeSet
representing the union of the specified ranges.boolean
RangeSet. enclosesAll(Iterable<Range<C>> other)
Returnstrue
if for each range inother
there exists a member range in this range set which encloses it.void
ImmutableRangeSet. removeAll(Iterable<Range<C>> other)
Deprecated.Unsupported operation.void
RangeSet. removeAll(Iterable<Range<C>> ranges)
Removes all of the specified ranges from this range set (optional operation).static <T extends @Nullable Object,K extends Comparable<? super K>,V>
Collector<T,?,ImmutableRangeMap<K,V>>ImmutableRangeMap. toImmutableRangeMap(Function<? super T,Range<K>> keyFunction, Function<? super T,? extends V> valueFunction)
Returns aCollector
that accumulates the input elements into a newImmutableRangeMap
.static <C extends Comparable<?>>
ImmutableRangeSet<C>ImmutableRangeSet. unionOf(Iterable<Range<C>> ranges)
Returns anImmutableRangeSet
representing the union of the specified ranges.
-