Class ForwardingNavigableMap.StandardDescendingMap
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.collect.ForwardingMap<K,V>
com.google.common.collect.ForwardingNavigableMap.StandardDescendingMap
- All Implemented Interfaces:
Map<K,V>, NavigableMap<K, V>, SequencedMap<K, V>, SortedMap<K, V>
A sensible implementation of
NavigableMap.descendingMap() in terms of the methods of this
NavigableMap. In many cases, you may wish to override ForwardingNavigableMap.descendingMap() to forward to this implementation or a subclass thereof.
In particular, this map iterates over entries with repeated calls to NavigableMap.lowerEntry(K). If a more efficient means of iteration is available, you may wish to
override the entryIterator() method of this class.
- Since:
- 12.0
- Author:
- Louis Wasserman
-
Nested Class Summary
Nested classes/interfaces inherited from class ForwardingMap
ForwardingMap.StandardEntrySet, ForwardingMap.StandardKeySet, ForwardingMap.StandardValuesModifier and TypeClassDescriptionprotected classA sensible implementation ofMap.entrySet()in terms of the following methods:ForwardingMap.clear(),ForwardingMap.containsKey(Object),ForwardingMap.get(Object),ForwardingMap.isEmpty(),ForwardingMap.remove(Object), andForwardingMap.size().protected classA sensible implementation ofMap.keySet()in terms of the following methods:ForwardingMap.clear(),ForwardingMap.containsKey(Object),ForwardingMap.isEmpty(),ForwardingMap.remove(Object),ForwardingMap.size(), and theSet.iterator()method ofForwardingMap.entrySet().protected classA sensible implementation ofMap.values()in terms of the following methods:ForwardingMap.clear(),ForwardingMap.containsValue(Object),ForwardingMap.isEmpty(),ForwardingMap.size(), and theSet.iterator()method ofForwardingMap.entrySet(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry(K key) ceilingKey(K key) Comparator<? super K> delegate()Returns the backing delegate instance that methods are forwarded to.entrySet()firstKey()floorEntry(K key) higherEntry(K key) keySet()lastKey()lowerEntry(K key) toString()Returns the string representation generated by the delegate'stoStringmethod.values()Methods inherited from class ForwardingMap
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, put, putAll, remove, size, standardClear, standardContainsKey, standardContainsValue, standardEquals, standardHashCode, standardIsEmpty, standardPutAll, standardRemove, standardToStringModifier and TypeMethodDescriptionvoidclear()booleancontainsKey(@Nullable Object key) booleancontainsValue(@Nullable Object value) booleaninthashCode()booleanisEmpty()voidintsize()protected voidA sensible definition ofForwardingMap.clear()in terms of theiteratormethod ofForwardingMap.entrySet().protected booleanA sensible, albeit inefficient, definition ofForwardingMap.containsKey(Object)in terms of theiteratormethod ofForwardingMap.entrySet().protected booleanstandardContainsValue(@Nullable Object value) A sensible definition ofForwardingMap.containsValue(Object)in terms of theiteratormethod ofForwardingMap.entrySet().protected booleanstandardEquals(@Nullable Object object) A sensible definition ofForwardingMap.equals(Object)in terms of theequalsmethod ofForwardingMap.entrySet().protected intA sensible definition ofForwardingMap.hashCode()in terms of theiteratormethod ofForwardingMap.entrySet().protected booleanA sensible definition ofForwardingMap.isEmpty()in terms of theiteratormethod ofForwardingMap.entrySet().protected voidstandardPutAll(Map<? extends K, ? extends V> map) A sensible definition ofForwardingMap.putAll(Map)in terms ofForwardingMap.put(Object, Object).protected VA sensible, albeit inefficient, definition ofForwardingMap.remove(Object)in terms of theiteratormethod ofForwardingMap.entrySet().protected StringA sensible definition ofForwardingObject.toString()in terms of theiteratormethod ofForwardingMap.entrySet().Methods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from interface NavigableMap
reversedMethods inherited from interface SequencedMap
sequencedEntrySet, sequencedKeySet, sequencedValues
-
Constructor Details
-
StandardDescendingMap
public StandardDescendingMap()Constructor for use by subclasses.
-
-
Method Details
-
entryIterator
-
delegate
Description copied from class:ForwardingObjectReturns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such asForwardingSet.delegate(). Concrete subclasses override this method to supply the instance being decorated. -
comparator
-
firstKey
-
lastKey
-
lowerEntry
-
lowerKey
-
floorEntry
-
floorKey
-
ceilingEntry
-
ceilingKey
- Specified by:
ceilingKeyin interfaceNavigableMap<K extends @Nullable Object, V extends @Nullable Object>
-
higherEntry
-
higherKey
-
firstEntry
- Specified by:
firstEntryin interfaceNavigableMap<K extends @Nullable Object, V extends @Nullable Object>- Specified by:
firstEntryin interfaceSequencedMap<K extends @Nullable Object, V extends @Nullable Object>
-
lastEntry
-
pollFirstEntry
- Specified by:
pollFirstEntryin interfaceNavigableMap<K extends @Nullable Object, V extends @Nullable Object>- Specified by:
pollFirstEntryin interfaceSequencedMap<K extends @Nullable Object, V extends @Nullable Object>
-
pollLastEntry
- Specified by:
pollLastEntryin interfaceNavigableMap<K extends @Nullable Object, V extends @Nullable Object>- Specified by:
pollLastEntryin interfaceSequencedMap<K extends @Nullable Object, V extends @Nullable Object>
-
descendingMap
- Specified by:
descendingMapin interfaceNavigableMap<K extends @Nullable Object, V extends @Nullable Object>
-
entrySet
-
keySet
-
descendingKeySet
- Specified by:
descendingKeySetin interfaceNavigableMap<K extends @Nullable Object, V extends @Nullable Object>
-
subMap
-
subMap
-
headMap
-
headMap
-
tailMap
-
tailMap
-
values
-
toString
Description copied from class:ForwardingObjectReturns the string representation generated by the delegate'stoStringmethod.- Overrides:
toStringin classForwardingObject
-