edu.emory.mathcs.backport.java.util.concurrent

Interface ConcurrentNavigableMap

All Superinterfaces:
ConcurrentMap, Map, NavigableMap, SortedMap
Known Implementing Classes:
ConcurrentSkipListMap

public interface ConcurrentNavigableMap
extends ConcurrentMap, NavigableMap

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.

Author:
Doug Lea
Since:
1.6

Method Summary

NavigableSet
descendingKeySet()
Returns a reverse order NavigableSet view of the keys contained in this map.
NavigableMap
descendingMap()
Returns a reverse order view of the mappings contained in this map.
SortedMap
headMap(Object toKey)
NavigableMap
headMap(Object toKey, boolean inclusive)
Set
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.
SortedMap
subMap(Object fromKey, Object toKey)
NavigableMap
subMap(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive)
SortedMap
tailMap(Object fromKey)
NavigableMap
tailMap(Object fromKey, boolean inclusive)

Methods inherited from interface edu.emory.mathcs.backport.java.util.concurrent.ConcurrentMap

putIfAbsent, remove, replace, replace

Methods inherited from interface edu.emory.mathcs.backport.java.util.NavigableMap

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

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 java.util.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
Returns:
a reverse order navigable set view of the keys in this map

descendingMap

public NavigableMap 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
Returns:
a reverse order view of this map

headMap

public SortedMap headMap(Object toKey)
Specified by:
headMap in interface NavigableMap

headMap

public NavigableMap headMap(Object toKey,
                            boolean inclusive)
Specified by:
headMap in interface NavigableMap

keySet

public Set 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 java.util.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.

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 java.util.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
Returns:
a navigable set view of the keys in this map

subMap

public SortedMap subMap(Object fromKey,
                        Object toKey)
Specified by:
subMap in interface NavigableMap

subMap

public NavigableMap subMap(Object fromKey,
                           boolean fromInclusive,
                           Object toKey,
                           boolean toInclusive)
Specified by:
subMap in interface NavigableMap

tailMap

public SortedMap tailMap(Object fromKey)
Specified by:
tailMap in interface NavigableMap

tailMap

public NavigableMap tailMap(Object fromKey,
                            boolean inclusive)
Specified by:
tailMap in interface NavigableMap