Package com.google.common.collect
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>,SortedMap<K,V>
- Enclosing class:
- ForwardingNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
protected class ForwardingNavigableMap.StandardDescendingMap extends ForwardingMap<K,V>
A sensible implementation ofNavigableMap.descendingMap()in terms of the methods of thisNavigableMap. In many cases, you may wish to overrideForwardingNavigableMap.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 theentryIterator()method of this class.- Since:
- 12.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.ForwardingMap
ForwardingMap.StandardEntrySet, ForwardingMap.StandardKeySet, ForwardingMap.StandardValues
-
-
Constructor Summary
Constructors Constructor Description StandardDescendingMap()Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable Map.Entry<K,V>ceilingEntry(K key)@Nullable KceilingKey(K key)Comparator<? super K>comparator()protected Map<K,V>delegate()Returns the backing delegate instance that methods are forwarded to.NavigableSet<K>descendingKeySet()NavigableMap<K,V>descendingMap()protected Iterator<Map.Entry<K,V>>entryIterator()Set<Map.Entry<K,V>>entrySet()@Nullable Map.Entry<K,V>firstEntry()KfirstKey()@Nullable Map.Entry<K,V>floorEntry(K key)@Nullable KfloorKey(K key)SortedMap<K,V>headMap(K toKey)NavigableMap<K,V>headMap(K toKey, boolean inclusive)@Nullable Map.Entry<K,V>higherEntry(K key)@Nullable KhigherKey(K key)Set<K>keySet()@Nullable Map.Entry<K,V>lastEntry()KlastKey()@Nullable Map.Entry<K,V>lowerEntry(K key)@Nullable KlowerKey(K key)NavigableSet<K>navigableKeySet()@Nullable Map.Entry<K,V>pollFirstEntry()@Nullable Map.Entry<K,V>pollLastEntry()NavigableMap<K,V>subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)SortedMap<K,V>subMap(K fromKey, K toKey)SortedMap<K,V>tailMap(K fromKey)NavigableMap<K,V>tailMap(K fromKey, boolean inclusive)StringtoString()Returns the string representation generated by the delegate'stoStringmethod.Collection<V>values()-
Methods inherited from class com.google.common.collect.ForwardingMap
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, put, putAll, remove, size, standardClear, standardContainsKey, standardContainsValue, standardEquals, standardHashCode, standardIsEmpty, standardPutAll, standardRemove, standardToString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
-
-
-
-
Constructor Detail
-
StandardDescendingMap
public StandardDescendingMap()
Constructor for use by subclasses.
-
-
Method Detail
-
entryIterator
protected Iterator<Map.Entry<K,V>> entryIterator()
-
delegate
protected final Map<K,V> 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.- Specified by:
delegatein classForwardingMap<K extends @Nullable Object,V extends @Nullable Object>
-
comparator
public Comparator<? super K> comparator()
- Specified by:
comparatorin interfaceSortedMap<K extends @Nullable Object,V extends @Nullable Object>
-
firstKey
public K firstKey()
-
lastKey
public K lastKey()
-
lowerEntry
public @Nullable Map.Entry<K,V> lowerEntry(K key)
- Specified by:
lowerEntryin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
lowerKey
public @Nullable K lowerKey(K key)
- Specified by:
lowerKeyin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
floorEntry
public @Nullable Map.Entry<K,V> floorEntry(K key)
- Specified by:
floorEntryin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
floorKey
public @Nullable K floorKey(K key)
- Specified by:
floorKeyin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
ceilingEntry
public @Nullable Map.Entry<K,V> ceilingEntry(K key)
- Specified by:
ceilingEntryin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
ceilingKey
public @Nullable K ceilingKey(K key)
- Specified by:
ceilingKeyin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
higherEntry
public @Nullable Map.Entry<K,V> higherEntry(K key)
- Specified by:
higherEntryin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
higherKey
public @Nullable K higherKey(K key)
- Specified by:
higherKeyin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
firstEntry
public @Nullable Map.Entry<K,V> firstEntry()
- Specified by:
firstEntryin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
lastEntry
public @Nullable Map.Entry<K,V> lastEntry()
- Specified by:
lastEntryin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
pollFirstEntry
public @Nullable Map.Entry<K,V> pollFirstEntry()
- Specified by:
pollFirstEntryin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
pollLastEntry
public @Nullable Map.Entry<K,V> pollLastEntry()
- Specified by:
pollLastEntryin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
descendingMap
public NavigableMap<K,V> descendingMap()
- Specified by:
descendingMapin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
keySet
public Set<K> keySet()
-
navigableKeySet
public NavigableSet<K> navigableKeySet()
- Specified by:
navigableKeySetin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
descendingKeySet
public NavigableSet<K> descendingKeySet()
- Specified by:
descendingKeySetin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
subMap
public NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
- Specified by:
subMapin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
subMap
public SortedMap<K,V> subMap(K fromKey, K toKey)
-
headMap
public NavigableMap<K,V> headMap(K toKey, boolean inclusive)
- Specified by:
headMapin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
headMap
public SortedMap<K,V> headMap(K toKey)
-
tailMap
public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive)
- Specified by:
tailMapin interfaceNavigableMap<K extends @Nullable Object,V extends @Nullable Object>
-
tailMap
public SortedMap<K,V> tailMap(K fromKey)
-
values
public Collection<V> values()
-
toString
public String toString()
Description copied from class:ForwardingObjectReturns the string representation generated by the delegate'stoStringmethod.- Overrides:
toStringin classForwardingObject
-
-