The type implementing this RangeSet
The type implementing this RangeSet
Adds the specified range to this RangeSet
(optional operation).
Adds the specified range to this RangeSet
(optional operation). That is, for equal
range sets a and b, the result of a.add(range)
is that a
will be the minimal
range set for which both a.enclosesAll(b)
and a.encloses(range)
.
Note that range
will be coalesced with any ranges in
the range set that are connected with it. Moreover,
if range
is empty, this is a no-op.
Returns a view of the disconnected ranges that make up this range set.
Returns a view of the disconnected ranges that make up this
range set. The returned set may be empty. The iterators returned by its
Iterable#iterator
method return the ranges in increasing order of lower bound
(equivalently, of upper bound).
Removes all ranges from this RangeSet
(optional operation).
Removes all ranges from this RangeSet
(optional operation). After this operation,
this.contains(c)
will return false for all c
.
This is equivalent to remove(Range.all())
.
Returns a view of the complement of this RangeSet
.
Returns a view of the complement of this RangeSet
.
Removes the specified range from this RangeSet
(optional operation).
Removes the specified range from this RangeSet
(optional operation). After this
operation, if range.contains(c)
, this.contains(c)
will return false
.
If range
is empty, this is a no-op.
Returns a Some
with the minimal range which encloses all ranges in this range set
or None
if this range set is empty
Returns a Some
with the minimal range which encloses all ranges in this range set
or None
if this range set is empty
Returns a view of the intersection of this RangeSet
with the specified range.
Returns a view of the intersection of this RangeSet
with the specified range.
Alias for #add(range)
Alias for #add(range)
Alias for #remove(range)
Alias for #remove(range)
Adds all of the ranges from the specified range set to this range set (optional operation).
Adds all of the ranges from the specified range set to this range set (optional operation).
After this operation, this range set is the minimal range set that
encloses both the original range set and other
.
This is equivalent to calling #add
on each of the ranges in other
in turn.
UnsupportedOperationException
if this range set does not support the addAll
operation
Determines whether any of this range set's member ranges contains value
.
Determines whether any of this range set's member ranges contains value
.
Returns true
if there exists a member range in this range set which
encloses the specified range.
Returns true
if there exists a member range in this range set which
encloses the specified range.
Returns true
if for each member range in other
there exists a member range in
this range set which encloses it.
Returns true
if for each member range in other
there exists a member range in
this range set which encloses it. It follows that this.contains(value)
whenever other.contains(value)
.
Returns true
if other
is empty.
This is equivalent to checking if this range set #encloses
each of the ranges in
other
.
Returns true
if obj
is another RangeSet
that contains the same ranges
according to Range#equals(Any)
.
Returns true
if obj
is another RangeSet
that contains the same ranges
according to Range#equals(Any)
.
Returns asRanges().hashCode()
.
Returns asRanges().hashCode()
.
Returns true
if this range set contains no ranges.
Returns true
if this range set contains no ranges.
Returns the unique range from this range set that contains
value
as Some(value)
, or None
if this range set does not contain value
.
Returns the unique range from this range set that contains
value
as Some(value)
, or None
if this range set does not contain value
.
Removes all of the ranges from the specified range set from this range set (optional operation).
Removes all of the ranges from the specified range set from this range set (optional
operation). After this operation, if other.contains(c)
, this.contains(c)
will
return false
.
This is equivalent to calling #remove
on each of the ranges in other
in
turn.
Returns a readable string representation of this range set.
Returns a readable string representation of this range set. For example, if this
RangeSet
consisted of Ranges.closed(1, 3)
and Ranges.greaterThan(4)
,
this might return "{[1‥3](4‥+∞)}"
.
Implementation trait for mutable RangeSet
A range set is a set comprising zero or more nonempty, disconnected ranges of type
C
for which anOrdering[C]
is defined.Note that the behavior of
Range#isEmpty()
andRange#isConnected(Range)
may not be as expected on discrete ranges. See the Scaladoc of those methods for details.For a
Set
whose contents are specified by a Range, see ContiguousSet.Usage example:
0.8