Added in API level 9

ConcurrentNavigableMap

interface ConcurrentNavigableMap<K : Any!, V : Any!> : ConcurrentMap<K, V>, NavigableMap<K, V>
java.util.concurrent.ConcurrentNavigableMap

A ConcurrentMap supporting NavigableMap operations, and recursively so for its navigable sub-maps.

This interface is a member of the Java Collections Framework.

Summary

Public methods
abstract NavigableSet<K>

Returns a reverse order NavigableSet view of the keys contained in this map.

abstract ConcurrentNavigableMap<K, V>

Returns a reverse order view of the mappings contained in this map.

abstract ConcurrentNavigableMap<K, V>
headMap(toKey: K, inclusive: Boolean)

abstract ConcurrentNavigableMap<K, V>
headMap(toKey: K)

abstract NavigableSet<K>

Returns a NavigableSet view of the keys contained in this map.

abstract ConcurrentNavigableMap<K, V>
subMap(fromKey: K, fromInclusive: Boolean, toKey: K, toInclusive: Boolean)

abstract ConcurrentNavigableMap<K, V>
subMap(fromKey: K, toKey: K)

abstract ConcurrentNavigableMap<K, V>
tailMap(fromKey: K, inclusive: Boolean)

abstract ConcurrentNavigableMap<K, V>
tailMap(fromKey: K)

Inherited functions
Properties
abstract NavigableSet<K>

Returns a NavigableSet view of the keys contained in this map.

Inherited properties

Public methods

descendingKeySet

Added in API level 9
abstract fun descendingKeySet(): NavigableSet<K>

Returns a reverse order NavigableSet view of the keys contained in this map. The set's iterator returns the keys in descending order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

The view's iterators and spliterators are weakly consistent.

Return
NavigableSet<K> a reverse order navigable set view of the keys in this map

descendingMap

Added in API level 9
abstract fun descendingMap(): ConcurrentNavigableMap<K, V>

Returns a reverse order view of the mappings contained in this map. The descending map is backed by this map, so changes to the map are reflected in the descending map, and vice-versa.

The returned map has an ordering equivalent to java.util.Collections#reverseOrder(Comparator)(comparator()). The expression m.descendingMap().descendingMap() returns a view of m essentially equivalent to m.

Return
ConcurrentNavigableMap<K, V> a reverse order view of this map

headMap

Added in API level 9
abstract fun headMap(
    toKey: K,
    inclusive: Boolean
): ConcurrentNavigableMap<K, V>
Parameters
toKey K: high endpoint of the keys in the returned map
inclusive Boolean: true if the high endpoint is to be included in the returned view
Return
ConcurrentNavigableMap<K, V> a view of the portion of this map whose keys are less than (or equal to, if inclusive is true) toKey
Exceptions
java.lang.ClassCastException if toKey is not compatible with this map's comparator (or, if the 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 map.
java.lang.NullPointerException if toKey is null and this map does not permit null keys
java.lang.IllegalArgumentException if this map itself has a restricted range, and toKey lies outside the bounds of the range

headMap

Added in API level 9
abstract fun headMap(toKey: K): ConcurrentNavigableMap<K, V>
Parameters
toKey K: high endpoint (exclusive) of the keys in the returned map
Return
ConcurrentNavigableMap<K, V> a view of the portion of this map whose keys are strictly less than toKey
Exceptions
java.lang.ClassCastException if toKey is not compatible with this map's comparator (or, if the 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 map.
java.lang.NullPointerException if toKey is null and this map does not permit null keys
java.lang.IllegalArgumentException if this map itself has a restricted range, and toKey lies outside the bounds of the range
Added in API level 9
abstract fun navigableKeySet(): NavigableSet<K>

Returns a NavigableSet view of the keys contained in this map. The set's iterator returns the keys in ascending order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

The view's iterators and spliterators are weakly consistent.

Return
NavigableSet<K> a navigable set view of the keys in this map

subMap

Added in API level 9
abstract fun subMap(
    fromKey: K,
    fromInclusive: Boolean,
    toKey: K,
    toInclusive: Boolean
): ConcurrentNavigableMap<K, V>
Parameters
fromKey K: low endpoint of the keys in the returned map
fromInclusive Boolean: true if the low endpoint is to be included in the returned view
toKey K: high endpoint of the keys in the returned map
toInclusive Boolean: true if the high endpoint is to be included in the returned view
Return
ConcurrentNavigableMap<K, V> a view of the portion of this map whose keys range from fromKey to toKey
Exceptions
java.lang.ClassCastException if fromKey and toKey cannot be compared to one another using this map's comparator (or, if the 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 map.
java.lang.NullPointerException if fromKey or toKey is null and this map does not permit null keys
java.lang.IllegalArgumentException if fromKey is greater than toKey; or if this map itself has a restricted range, and fromKey or toKey lies outside the bounds of the range

subMap

Added in API level 9
abstract fun subMap(
    fromKey: K,
    toKey: K
): ConcurrentNavigableMap<K, V>
Parameters
fromKey K: low endpoint (inclusive) of the keys in the returned map
toKey K: high endpoint (exclusive) of the keys in the returned map
Return
ConcurrentNavigableMap<K, V> a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive
Exceptions
java.lang.ClassCastException if fromKey and toKey cannot be compared to one another using this map's comparator (or, if the 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 map.
java.lang.NullPointerException if fromKey or toKey is null and this map does not permit null keys
java.lang.IllegalArgumentException if fromKey is greater than toKey; or if this map itself has a restricted range, and fromKey or toKey lies outside the bounds of the range

tailMap

Added in API level 9
abstract fun tailMap(
    fromKey: K,
    inclusive: Boolean
): ConcurrentNavigableMap<K, V>
Parameters
fromKey K: low endpoint of the keys in the returned map
inclusive Boolean: true if the low endpoint is to be included in the returned view
Return
ConcurrentNavigableMap<K, V> a view of the portion of this map whose keys are greater than (or equal to, if inclusive is true) fromKey
Exceptions
java.lang.ClassCastException if fromKey is not compatible with this map's comparator (or, if the 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 map.
java.lang.NullPointerException if fromKey is null and this map does not permit null keys
java.lang.IllegalArgumentException if this map itself has a restricted range, and fromKey lies outside the bounds of the range

tailMap

Added in API level 9
abstract fun tailMap(fromKey: K): ConcurrentNavigableMap<K, V>
Parameters
fromKey K: low endpoint (inclusive) of the keys in the returned map
Return
ConcurrentNavigableMap<K, V> a view of the portion of this map whose keys are greater than or equal to fromKey
Exceptions
java.lang.ClassCastException if fromKey is not compatible with this map's comparator (or, if the 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 map.
java.lang.NullPointerException if fromKey is null and this map does not permit null keys
java.lang.IllegalArgumentException if this map itself has a restricted range, and fromKey lies outside the bounds of the range

Properties

keys

Added in API level 9
abstract val keys: NavigableSet<K>

Returns a NavigableSet view of the keys contained in this map. The set's iterator returns the keys in ascending order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

The view's iterators and spliterators are weakly consistent.

This method is equivalent to method navigableKeySet.

Return
NavigableSet<K> a navigable set view of the keys in this map