|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SortedMap<K,V>
SortedMap defines the interface for maps that are sorted by their key.
| Method Summary | |
|---|---|
SortedMap<K,V> |
asSortedMap()
Returns an immutable view of this map as an instance of java.util.SortedMap. |
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. |
| Methods inherited from interface com.github.andrewoma.dexx.collection.Map |
|---|
asMap, containsKey, get, keys, values |
| Methods inherited from interface com.github.andrewoma.dexx.collection.Iterable |
|---|
iterator |
| Methods inherited from interface com.github.andrewoma.dexx.collection.Traversable |
|---|
forEach, isEmpty, makeString, makeString, size, to, toArray, toArray, toIndexedList, toSet, toSortedSet |
| Method Detail |
|---|
@NotNull
SortedMap<K,V> put(@NotNull
K key,
V value)
MapIf value already exists for the key, it will be replaced.
put in interface Map<K,V>
@NotNull
SortedMap<K,V> remove(@NotNull
K key)
Map
remove in interface Map<K,V>
@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 excludedComparator<? super K> comparator()
null if the default ordering is used.
@Nullable Pair<K,V> first()
null if the map is empty.
@Nullable Pair<K,V> last()
null if the map is empty.
@NotNull SortedMap<K,V> drop(int number)
number of elements.
@NotNull SortedMap<K,V> take(int number)
number of elements from this list.
@NotNull SortedMap<K,V> asSortedMap()
java.util.SortedMap.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||