T - the type of values in ranges.public static class LongPairRangeSet.DefaultRangeSet<T extends Comparable<T>> extends Object implements LongPairRangeSet<T>
LongPairRangeSet.DefaultRangeSet<T extends Comparable<T>>, LongPairRangeSet.LongPair, LongPairRangeSet.LongPairConsumer<T>, LongPairRangeSet.RangeProcessor<T extends Comparable<T>>| Constructor and Description |
|---|
DefaultRangeSet(LongPairRangeSet.LongPairConsumer<T> consumer) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOpenClosed(long key1,
long value1,
long key2,
long value2)
Adds the specified range (range that contains all values strictly greater than
lower and less than or equal to upper.) to this RangeSet (optional operation). |
Set<com.google.common.collect.Range<T>> |
asRanges()
Returns a view of the disconnected ranges that make up this range set.
|
void |
clear() |
boolean |
contains(long key,
long value)
Determines whether any of this range set's member ranges contains
value. |
boolean |
contains(T position) |
com.google.common.collect.Range<T> |
firstRange()
It returns very first smallest range in the rangeSet.
|
void |
forEach(LongPairRangeSet.RangeProcessor<T> action)
Performs the given action for each entry in this map until all entries have been processed
or action returns "false".
|
void |
forEach(LongPairRangeSet.RangeProcessor<T> action,
LongPairRangeSet.LongPairConsumer<? extends T> consumer)
Performs the given action for each entry in this map until all entries have been processed
or action returns "false".
|
boolean |
isEmpty() |
com.google.common.collect.Range<T> |
lastRange()
It returns very last biggest range in the rangeSet.
|
com.google.common.collect.Range<T> |
rangeContaining(long key,
long value)
Returns the unique range from this range set that contains
value, or
null if this range set does not contain value. |
com.google.common.collect.Range<T> |
rangeContaining(T position) |
void |
remove(com.google.common.collect.Range<T> range) |
void |
removeAtMost(long key,
long value)
Remove range that contains all values less than or equal to given key-value.
|
int |
size()
Returns total number of ranges into the set.
|
com.google.common.collect.Range<T> |
span()
Returns the minimal range which encloses all ranges in this range set.
|
String |
toString() |
public DefaultRangeSet(LongPairRangeSet.LongPairConsumer<T> consumer)
public void clear()
clear in interface LongPairRangeSet<T extends Comparable<T>>public void addOpenClosed(long key1,
long value1,
long key2,
long value2)
LongPairRangeSetlower and less than or equal to upper.) 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).
@param lowerKey : value for key of lowerEndpoint of Range @param lowerValue: value for value of lowerEndpoint of Range @param upperKey : value for key of upperEndpoint of Range @param upperValue: value for value of upperEndpoint of Range
addOpenClosed in interface LongPairRangeSet<T extends Comparable<T>>public boolean contains(T position)
public com.google.common.collect.Range<T> rangeContaining(long key, long value)
LongPairRangeSetvalue, or
null if this range set does not contain value.rangeContaining in interface LongPairRangeSet<T extends Comparable<T>>public void remove(com.google.common.collect.Range<T> range)
public void removeAtMost(long key,
long value)
LongPairRangeSetremoveAtMost in interface LongPairRangeSet<T extends Comparable<T>>public boolean isEmpty()
isEmpty in interface LongPairRangeSet<T extends Comparable<T>>public com.google.common.collect.Range<T> span()
LongPairRangeSetspan in interface LongPairRangeSet<T extends Comparable<T>>public Set<com.google.common.collect.Range<T>> asRanges()
LongPairRangeSetasRanges in interface LongPairRangeSet<T extends Comparable<T>>public void forEach(LongPairRangeSet.RangeProcessor<T> action)
LongPairRangeSetforEach in interface LongPairRangeSet<T extends Comparable<T>>public void forEach(LongPairRangeSet.RangeProcessor<T> action, LongPairRangeSet.LongPairConsumer<? extends T> consumer)
LongPairRangeSetforEach in interface LongPairRangeSet<T extends Comparable<T>>public boolean contains(long key,
long value)
LongPairRangeSetvalue.contains in interface LongPairRangeSet<T extends Comparable<T>>public com.google.common.collect.Range<T> firstRange()
LongPairRangeSetfirstRange in interface LongPairRangeSet<T extends Comparable<T>>public com.google.common.collect.Range<T> lastRange()
LongPairRangeSetlastRange in interface LongPairRangeSet<T extends Comparable<T>>public int size()
LongPairRangeSetsize in interface LongPairRangeSet<T extends Comparable<T>>Copyright © 2017–2022 Apache Software Foundation. All rights reserved.