Returns this RangeMap as a map of ranges.
Returns this RangeMap as a map of ranges.
Warning: This differs from Guava which returns an unmodifiable view of this RangeMap which modifications to its range map are guaranteed to read through to the returned map.
It is guaranteed that no empty ranges will be in the returned Map
.
Returns the value associated with the specified key in a Some
, or None
if there is no
such value.
Returns the value associated with the specified key in a Some
, or None
if there is no
such value.
Specifically, if any range in this range map contains the specified key, the value associated with that range is returned.
Returns the range containing this key and its associated value in a Some
, if such a range is present
in the range map, or None
otherwise.
Returns the range containing this key and its associated value in a Some
, if such a range is present
in the range map, or None
otherwise.
Returns the minimal range enclosing the ranges in this RangeMap
in a Some
or None
if this range map is empty
Returns the minimal range enclosing the ranges in this RangeMap
in a Some
or None
if this range map is empty
Returns a view of the part of this range map that intersects with range
.
Returns a view of the part of this range map that intersects with range
.
For example, if rangeMap
had the entries
[1, 5] => "foo", (6, 8) => "bar", (10, ‥) => "baz"
then rangeMap.subRangeMap(Range.open(3, 12))
would return a range map
with the entries (3, 5) => "foo", (6, 8) => "bar", (10, 12) => "baz"
.
The returned range map supports all optional operations that this range map supports.
Returns true
if obj
is another RangeMap that has an equivalent
#asMapOfRanges()
.
Returns true
if obj
is another RangeMap that has an equivalent
#asMapOfRanges()
.
Returns asMapOfRanges().hashCode()
.
Returns asMapOfRanges().hashCode()
.
Returns true
if this range map contains no ranges.
Returns true
if this range map contains no ranges.
Returns a readable string representation of this range map.
Returns a readable string representation of this range map.
A base trait for all
RangeMap
, mutable as well as immutableA mapping from disjoint nonempty ranges to non-null values. Queries look up the value associated with the range (if any) that contains a specified key.
In contrast to RangeSet, no "coalescing" is done of connected ranges, even if they are mapped to the same value.
Usage example:
0.9