V
- the type of mapped valuespublic class IntervalSet<V> extends Object implements Iterable<V>
Interval sets are optimized for being queried far more often than they are modified.
This set does not support null keys or values, but does support duplicate intervals.
Constructor and Description |
---|
IntervalSet() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all values from this set.
|
Iterator<V> |
iterator() |
Optional<V> |
put(long low,
long high,
V value)
Associates the specified interval with the specified value in this set.
|
Optional<V> |
removeFirst(long low,
long high,
Predicate<? super V> criteria)
Removes the first value for the specified interval from this set that
matches the given criteria.
|
int |
size()
Returns the size of this set.
|
Iterable<V> |
subSet(long low,
long high)
Returns an iterable read only view of the values in this set that
overlaps the specified interval.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public IntervalSet()
public void clear()
public int size()
public Optional<V> put(long low, long high, V value)
low
- the low end of the range the specified value to associatehigh
- the high end of the range the specified value to associatevalue
- value to be associated with the specified keyNullPointerException
- if the specified key or value is nullpublic Optional<V> removeFirst(long low, long high, Predicate<? super V> criteria)
low
- the low end of the range the specified value to associatehigh
- the high end of the range the specified value to associatecriteria
- the value to deleteIllegalArgumentException
- if low
is greater than high
NullPointerException
- if the specified key is nullpublic Iterable<V> subSet(long low, long high)
low
and high
are
equal, the returned view contains the intervals containing a single
point.low
- low portion of the interval to retrievehigh
- high portion of the interval to retrieveIllegalArgumentException
- if low
is greater than high
Copyright © 2015 Kreatious LLC. All rights reserved.