Package org.n52.janmayen
Interface IntervalMap<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Known Implementing Classes:
IntervalTree
public interface IntervalMap<K,V>
A map that uses intervals (specified as an upper and lower bound) as keys.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> IntervalMap <K, V> empty()Get the value of the first interval matching the supplied key.Get the first value falling into the interval.default VgetOrDefault(K lower, K upper, V value) Get the first value falling into the interval or the supplied default.default VgetOrDefault(K key, V value) Get the first value for the specified key or the supplied default.Get the values for all intervals matching the supplied key.Get all values falling into the specified interval.static <K,V> IntervalMap <K, V> universal(V value) Creates aIntervalMapthat returns the same value for each key.
-
Field Details
-
EMPTY
-
-
Method Details
-
get
Get the value of the first interval matching the supplied key.- Parameters:
key- the key- Returns:
- the value
-
get
Get the first value falling into the interval.- Parameters:
lower- the lower boundupper- the upper bound- Returns:
- the value
-
getOrDefault
Get the first value for the specified key or the supplied default.- Parameters:
key- the keyvalue- the default value- Returns:
- the value
-
getOrDefault
Get the first value falling into the interval or the supplied default.- Parameters:
lower- the lower boundupper- the upper boundvalue- the default value- Returns:
- the value
-
search
Get the values for all intervals matching the supplied key.- Parameters:
key- the key- Returns:
- the values
-
search
Get all values falling into the specified interval.- Parameters:
lower- the upper boundupper- the lower bound- Returns:
- the values
-
universal
Creates aIntervalMapthat returns the same value for each key.- Type Parameters:
K- the key typeV- the value type- Parameters:
value- the value- Returns:
- the
IntervalMap
-
empty
-