K
- the key type of content of this MapV
- the value type of content of this Mappublic interface ImmutableSortedMap<K,V> extends ImmutableMap<K,V>
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Method and Description |
---|---|
Comparator<? super K> |
comparator()
Returns the comparator used to order the keys in this immutable map, or null if this immutable map uses the
natural ordering of its keys.
|
boolean |
equals(Object obj)
Force to redefine equals for the implementations of immutable collection classes.
|
K |
firstKey()
Returns the first (lowest) key currently in this immutable map.
|
int |
hashCode()
Force to redefine hashCode for the implementations of immutable collection classes.
|
ImmutableSortedMap<K,V> |
headMap(K toKey)
Returns a view of the portion of this immutable map whose keys are strictly less than toKey.
|
ImmutableSortedSet<K> |
keySet()
Return an ImmutableSortedSet view of the keys contained in this immutable map.
|
K |
lastKey()
Returns the last (highest) key currently in this immutable map.
|
ImmutableSortedMap<K,V> |
subMap(K fromKey,
K toKey)
Returns a view of the portion of this immutable map whose keys range from fromKey, inclusive, to
toKey, exclusive.
|
ImmutableSortedMap<K,V> |
tailMap(K fromKey)
Returns a view of the portion of this immutable map whose keys are greater than or equal to fromKey.
|
SortedMap<K,V> |
toMap()
Returns a modifiable copy of this immutable map.
|
containsKey, containsValue, forEach, get, getOrDefault, isCopy, isEmpty, isWrap, size, values
SortedMap<K,V> toMap()
toMap
in interface ImmutableMap<K,V>
Comparator<? super K> comparator()
ImmutableSortedMap<K,V> subMap(K fromKey, K toKey)
The result of this method is a new, immutable sorted map.
fromKey
- low endpoint (inclusive) of the returned immutable maptoKey
- high endpoint (exclusive) of the returned immutable mapClassCastException
- if fromKey and toKey cannot be compared to one another using this
immutable map's comparator (or, if the immutable map has no comparator, using natural ordering).
Implementations may, but are not required to, throw this exception if fromKey or
toKey cannot be compared to keys currently in the immutable map.NullPointerException
- if fromKey or toKey is null and this immutable map does not permit
null keysIllegalArgumentException
- if fromKey is greater than toKey; or if this immutable map
itself has a restricted range, and fromKey or toKey lies outside the bounds of the
rangeImmutableSortedMap<K,V> headMap(K toKey)
The result of this method is a new, immutable sorted map.
toKey
- high endpoint (exclusive) of the returned immutable mapClassCastException
- if toKey is not compatible with this immutable map's comparator (or, if the
immutable map has no comparator, if toKey does not implement Comparable
).
Implementations may, but are not required to, throw this exception if toKey cannot be compared
to keys currently in the immutable map.NullPointerException
- if toKey is null and this immutable map does not permit null keysIllegalArgumentException
- if this immutable map itself has a restricted range, and toKey lies outside
the bounds of the rangeImmutableSortedMap<K,V> tailMap(K fromKey)
The result of this method is a new, immutable sorted map.
fromKey
- low endpoint (inclusive) of the returned immutable mapClassCastException
- if fromKey is not compatible with this immutable map's comparator (or, if the
immutable map has no comparator, if fromKey does not implement Comparable
).
Implementations may, but are not required to, throw this exception if fromKey cannot be compared
to keys currently in the immutable map.NullPointerException
- if fromKey is null and this immutable map does not permit null keysIllegalArgumentException
- if this immutable map itself has a restricted range, and fromKey lies
outside the bounds of the rangeK firstKey()
NoSuchElementException
- if this immutable map is emptyK lastKey()
NoSuchElementException
- if this immutable map is emptyImmutableSortedSet<K> keySet()
keySet
in interface ImmutableMap<K,V>
boolean equals(Object obj)
Copyright © 2014–2016 Delft University of Technology. All rights reserved.