Uses of Class
com.google.common.collect.Range
Packages that use Range
Package
Description
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 RangeModifier and TypeMethodDescriptionstatic <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.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 tolowerand 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 tolowerand strictly less thanupper.static <C extends Comparable<?>>
Range<C> 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.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.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 thanlowerand strictly less thanupper.static <C extends Comparable<?>>
Range<C> Range.openClosed(C lower, C upper) Returns a range that contains all values strictly greater thanlowerand less than or equal toupper.ContiguousSet.range()Returns a range, closed on both ends, whose endpoints are the minimum and maximum values contained in this set.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> Returns a range that contains any value fromlowertoupper, where each endpoint may be either inclusive (closed) or exclusive (open).ImmutableRangeSet.rangeContaining(C value) RangeSet.rangeContaining(C value) Returns the unique range from this range set that containsvalue, ornullif this range set does not containvalue.TreeRangeSet.rangeContaining(C value) static <C extends Comparable<?>>
Range<C> Range.singleton(C value) Returns a range that contains only the given value.ImmutableRangeMap.span()ImmutableRangeSet.span()Returns the minimal range that encloses both this range andother.RangeMap.span()Returns the minimal range enclosing the ranges in thisRangeMap.RangeSet.span()Returns the minimal range which encloses all ranges in this range set.TreeRangeMap.span()TreeRangeSet.span()static <C extends Comparable<?>>
Range<C> 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 RangeModifier and TypeMethodDescriptionImmutableMap<Range<K>, V> ImmutableRangeMap.asDescendingMapOfRanges()RangeMap.asDescendingMapOfRanges()Returns a view of this range map as an unmodifiableMap<Range<K>, V>.TreeRangeMap.asDescendingMapOfRanges()ImmutableRangeSet.asDescendingSetOfRanges()RangeSet.asDescendingSetOfRanges()Returns a descending view of the disconnected ranges that make up this range set.TreeRangeSet.asDescendingSetOfRanges()ImmutableMap<Range<K>, V> ImmutableRangeMap.asMapOfRanges()RangeMap.asMapOfRanges()Returns a view of this range map as an unmodifiableMap<Range<K>, V>.TreeRangeMap.asMapOfRanges()ImmutableRangeSet.asRanges()RangeSet.asRanges()Returns a view of the disconnected ranges that make up this range set.TreeRangeSet.asRanges()Returns the range containing this key and its associated value, if such a range is present in the range map, ornullotherwise.static <E extends Comparable<? super E>>
Collector<Range<E>, ?, ImmutableRangeSet<E>> ImmutableRangeSet.toImmutableRangeSet()Returns aCollectorthat accumulates the input elements into a newImmutableRangeSet.Methods in com.google.common.collect with parameters of type RangeModifier and TypeMethodDescriptionvoidDeprecated.Unsupported operation.Add the specified range to this builder.voidAdds the specified range to thisRangeSet(optional operation).voidstatic <C extends Comparable>
ContiguousSet<C> ContiguousSet.create(Range<C> range, DiscreteDomain<C> domain) Returns aContiguousSetcontaining the same values in the given domain contained by the range.booleanbooleanReturnstrueif the bounds ofotherdo not extend outside the bounds of this range.booleanReturnstrueif there exists a member range in this range set which encloses the specified range.booleanReturns the maximal range lying between this range andotherRange, if such a range exists.Range.intersection(Range<C> connectedRange) Returns the maximal range enclosed by both this range andconnectedRange, if such a range exists.booleanImmutableRangeSet.intersects(Range<C> otherRange) booleanRangeSet.intersects(Range<C> otherRange) Returnstrueif there exists a non-empty range enclosed by both a member range in this range set and the specified range.booleanTreeRangeSet.intersects(Range<C> range) booleanRange.isConnected(Range<C> other) Returnstrueif there exists a (possibly empty) range which is enclosed by both this range andother.final voidImmutableRangeMap.merge(Range<K> range, @Nullable V value, BiFunction<? super V, ? super @Nullable V, ? extends @Nullable V> remappingFunction) Deprecated.Unsupported operation.voidRangeMap.merge(Range<K> range, @Nullable V value, BiFunction<? super V, ? super @Nullable V, ? extends @Nullable V> remappingFunction) Merges a value into a part of the map by applying a remapping function.voidTreeRangeMap.merge(Range<K> range, @Nullable V value, BiFunction<? super V, ? super @Nullable V, ? extends @Nullable V> remappingFunction) static <K extends Comparable<?>, V>
ImmutableRangeMap<K, V> Returns an immutable range map mapping a single range to a single value.static <C extends Comparable>
ImmutableRangeSet<C> Returns an immutable range set containing the specified single range.Associates the specified range with the specified value.final voidDeprecated.Unsupported operation.voidMaps a range to a specified value (optional operation).voidfinal voidImmutableRangeMap.putCoalescing(Range<K> range, V value) Deprecated.Unsupported operation.voidRangeMap.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.voidTreeRangeMap.putCoalescing(Range<K> range, V value) final voidDeprecated.Unsupported operation.voidDeprecated.Unsupported operation.voidRemoves all associations from this range map in the specified range (optional operation).voidRemoves the specified range from thisRangeSet(optional operation).voidvoidReturns 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 ofmapwhose keys are contained byrange.ImmutableRangeMap.subRangeMap(Range<K> range) RangeMap.subRangeMap(Range<K> range) Returns a view of the part of this range map that intersects withrange.TreeRangeMap.subRangeMap(Range<K> subRange) ImmutableRangeSet.subRangeSet(Range<C> range) Returns a view of the intersection of this range set with the given range.RangeSet.subRangeSet(Range<C> view) Returns a view of the intersection of thisRangeSetwith the specified range.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 ofsetwhose elements are contained byrange.Method parameters in com.google.common.collect with type arguments of type RangeModifier and TypeMethodDescriptionvoidDeprecated.Unsupported operation.Add all of the specified ranges to this builder.default voidAdds all of the specified ranges to this range set (optional operation).static <C extends Comparable<?>>
ImmutableRangeSet<C> Returns anImmutableRangeSetcontaining each of the specified disjoint ranges.static <C extends Comparable<?>>
TreeRangeSet<C> Returns aTreeRangeSetrepresenting the union of the specified ranges.default booleanRangeSet.enclosesAll(Iterable<Range<C>> other) Returnstrueif for each range inotherthere exists a member range in this range set which encloses it.voidDeprecated.Unsupported operation.default voidRemoves 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 aCollectorthat accumulates the input elements into a newImmutableRangeMap.static <C extends Comparable<?>>
ImmutableRangeSet<C> Returns anImmutableRangeSetrepresenting the union of the specified ranges.