java.util.concurrent

Interface ConcurrentNavigableMap<K,V>

All Superinterfaces:
ConcurrentMap<K,V>, Map<K,V>, NavigableMap<K,V>, SortedMap<K,V>
Known Implementing Classes:
ConcurrentSkipListMap<K,V>

public interface ConcurrentNavigableMap<K,V>
extends ConcurrentMap<K,V>, NavigableMap<K,V>

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

This interface is a member of the ../../../../technotes/guides/collections/index.html"> Java Collections Framework.

Since:
1.6

Method Summary

NavigableSet
descendingKeySet()
Returns a reverse order NavigableSet view of the keys contained in this map.
ConcurrentNavigableMap
descendingMap()
Returns a reverse order view of the mappings contained in this map.
ConcurrentNavigableMap
headMap(K toKey)
ConcurrentNavigableMap
headMap(K toKey, boolean inclusive)
NavigableSet
keySet()
Returns a NavigableSet view of the keys contained in this map.
NavigableSet
navigableKeySet()
Returns a NavigableSet view of the keys contained in this map.
ConcurrentNavigableMap
subMap(K fromKey, K toKey)
ConcurrentNavigableMap
subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
ConcurrentNavigableMap
tailMap(K fromKey)
ConcurrentNavigableMap
tailMap(K fromKey, boolean inclusive)

Methods inherited from interface java.util.concurrent.ConcurrentMap<K,V>

putIfAbsent, remove, replace, replace

Methods inherited from interface java.util.Map<K,V>

V>> entrySet, clear, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Methods inherited from interface java.util.NavigableMap<K,V>

ceilingEntry, ceilingKey, descendingKeySet, descendingMap, firstEntry, floorEntry, floorKey, headMap, headMap, higherEntry, higherKey, lastEntry, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, subMap, subMap, tailMap, tailMap

Methods inherited from interface java.util.SortedMap<K,V>

V> headMap, V> subMap, V> tailMap, firstKey, lastKey, super K> comparator

Method Details

descendingKeySet

public NavigableSet descendingKeySet()
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 iterator is a "weakly consistent" iterator that will never throw ConcurrentModificationException, and guarantees to traverse elements as they existed upon construction of the iterator, and may (but is not guaranteed to) reflect any modifications subsequent to construction.

Specified by:
descendingKeySet in interface NavigableMap<K,V>
Returns:
a reverse order navigable set view of the keys in this map

descendingMap

public ConcurrentNavigableMap descendingMap()
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 Collections.reverseOrder(comparator()). The expression m.descendingMap().descendingMap() returns a view of m essentially equivalent to m.

Specified by:
descendingMap in interface NavigableMap<K,V>
Returns:
a reverse order view of this map

headMap

public ConcurrentNavigableMap headMap(K toKey)
Specified by:
headMap in interface NavigableMap<K,V>

headMap

public ConcurrentNavigableMap headMap(K toKey,
                                           boolean inclusive)
Specified by:
headMap in interface NavigableMap<K,V>

keySet

public NavigableSet keySet()
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 iterator is a "weakly consistent" iterator that will never throw ConcurrentModificationException, and guarantees to traverse elements as they existed upon construction of the iterator, and may (but is not guaranteed to) reflect any modifications subsequent to construction.

This method is equivalent to method navigableKeySet.

Specified by:
keySet in interface Map<K,V>
Returns:
a navigable set view of the keys in this map

navigableKeySet

public NavigableSet navigableKeySet()
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 iterator is a "weakly consistent" iterator that will never throw ConcurrentModificationException, and guarantees to traverse elements as they existed upon construction of the iterator, and may (but is not guaranteed to) reflect any modifications subsequent to construction.

Specified by:
navigableKeySet in interface NavigableMap<K,V>
Returns:
a navigable set view of the keys in this map

subMap

public ConcurrentNavigableMap subMap(K fromKey,
                                          K toKey)
Specified by:
subMap in interface NavigableMap<K,V>

subMap

public ConcurrentNavigableMap subMap(K fromKey,
                                          boolean fromInclusive,
                                          K toKey,
                                          boolean toInclusive)
Specified by:
subMap in interface NavigableMap<K,V>

tailMap

public ConcurrentNavigableMap tailMap(K fromKey)
Specified by:
tailMap in interface NavigableMap<K,V>

tailMap

public ConcurrentNavigableMap tailMap(K fromKey,
                                           boolean inclusive)
Specified by:
tailMap in interface NavigableMap<K,V>