public interface SortedMap<K,V> extends Map<K,V>
| Modifier and Type | Method and Description |
|---|---|
java.util.SortedMap<K,V> |
asSortedMap()
Returns an immutable view of this map as an instance of
java.util.SortedMap. |
java.util.Comparator<? super K> |
comparator()
Returns the comparator associated with this map, or
null if the default ordering is used. |
SortedMap<K,V> |
drop(int number)
Returns a map containing all elements in this map, excluding the first
number of elements. |
Pair<K,V> |
first()
Returns the first entry in the map or
null if the map is empty. |
SortedMap<K,V> |
from(K key,
boolean inclusive)
Returns the bottom of the map starting from the key specified.
|
Pair<K,V> |
last()
Returns the last entry in the map or
null if the map is empty. |
SortedMap<K,V> |
put(K key,
V value)
Returns a map with the value specified associated to the key specified.
|
SortedMap<K,V> |
range(K from,
boolean fromInclusive,
K to,
boolean toInclusive)
Returns a subset of the map between the
from and to keys specified. |
SortedMap<K,V> |
remove(K key)
Returns a map with the value associated with the key removed if it exists.
|
SortedMap<K,V> |
take(int number)
Returns a list containing the first
number of elements from this list. |
SortedMap<K,V> |
to(K key,
boolean inclusive)
Returns the top of the map up until the key specified.
|
asMap, containsKey, get, keys, valuesforEach, isEmpty, makeString, makeString, size, to, toArray, toArray, toIndexedList, toSet, toSortedSet@NotNull SortedMap<K,V> put(@NotNull K key, V value)
MapIf value already exists for the key, it will be replaced.
@NotNull SortedMap<K,V> remove(@NotNull K key)
Map@NotNull SortedMap<K,V> from(@NotNull K key, boolean inclusive)
inclusive - if true, the key will be included in the result, otherwise it will be excluded@NotNull SortedMap<K,V> to(@NotNull K key, boolean inclusive)
inclusive - if true, the key will be included in the result, otherwise it will be excluded@NotNull SortedMap<K,V> range(@NotNull K from, boolean fromInclusive, @NotNull K to, boolean toInclusive)
from and to keys specified.fromInclusive - if true, the key will be included in the result, otherwise it will be excludedtoInclusive - if true, the key will be included in the result, otherwise it will be excludedjava.util.Comparator<? super K> comparator()
null if the default ordering is used.@NotNull SortedMap<K,V> drop(int number)
number of elements.@NotNull SortedMap<K,V> take(int number)
number of elements from this list.