Top Description Inners Constructors Methods
com.google.common.collect

pack-priv abstract Class AbstractNavigableMap<K extends @Nullable Object, V extends @Nullable Object>

extends Maps.IteratorBasedAbstractMap<K extends @Nullable Object, V extends @Nullable Object>
implements NavigableMap<K extends @Nullable Object, V extends @Nullable Object>
Class Inheritance
All Implemented Interfaces
java.util.NavigableMap, java.util.SortedMap, java.util.SequencedMap, java.util.Map
Known Direct Subclasses
com.google.common.collect.Maps.NavigableAsMapView, com.google.common.collect.Maps.FilteredEntryNavigableMap, com.google.common.collect.TreeRangeSet.RangesByUpperBound, com.google.common.collect.TreeRangeSet.ComplementRangesByLowerBound, com.google.common.collect.TreeRangeSet.SubRangeSetRangesByLowerBound
Annotations
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtIncompatible, com.google.common.collect.Maps.IteratorBasedAbstractMap, java.util.Iterator, .NavigableMap, .NavigableSet, .NoSuchElementException, .Set, .SortedMap, javax.annotation.CheckForNull, org.checkerframework.checker.nullness.qual.Nullable

Skeletal implementation of NavigableMap.
Author
Louis Wasserman

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Map.Entry<K, V>
ceilingEntry(K
the key
key
)

Implements java.util.NavigableMap.ceilingEntry.

Returns a key-value mapping associated with the least key greater than or equal to the given key, or null if there is no such key.
public K
ceilingKey(K
the key
key
)

Implements java.util.NavigableMap.ceilingKey.

Returns the least key greater than or equal to the given key, or null if there is no such key.
pack-priv abstract Iterator<Map.Entry<K, V>>
public NavigableSet<K>
descendingKeySet()

Implements java.util.NavigableMap.descendingKeySet.

Returns a reverse order NavigableSet view of the keys contained in this map.
public NavigableMap<K, V>
descendingMap()

Implements java.util.NavigableMap.descendingMap.

Returns a reverse order view of the mappings contained in this map.
public Map.Entry<K, V>
firstEntry()

Implements java.util.NavigableMap.firstEntry.

Returns a key-value mapping associated with the least key in this map, or null if the map is empty.
public K
firstKey()

Implements java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.
public Map.Entry<K, V>
floorEntry(K
the key
key
)

Implements java.util.NavigableMap.floorEntry.

Returns a key-value mapping associated with the greatest key less than or equal to the given key, or null if there is no such key.
public K
floorKey(K
the key
key
)

Implements java.util.NavigableMap.floorKey.

Returns the greatest key less than or equal to the given key, or null if there is no such key.
public abstract V
get(Object
the key whose associated value is to be returned
key
)

Redeclares java.util.Map.get.

Overrides java.util.AbstractMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
public SortedMap<K, V>
headMap(K
high endpoint (exclusive) of the keys in the returned map
toKey
)

Implements java.util.NavigableMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey.
public Map.Entry<K, V>
higherEntry(K
the key
key
)

Implements java.util.NavigableMap.higherEntry.

Returns a key-value mapping associated with the least key strictly greater than the given key, or null if there is no such key.
public K
higherKey(K
the key
key
)

Implements java.util.NavigableMap.higherKey.

Returns the least key strictly greater than the given key, or null if there is no such key.
public Set<K>
keySet()

Overrides java.util.AbstractMap.keySet.

Implements java.util.SortedMap.keySet, java.util.Map.keySet.

Returns a Set view of the keys contained in this map.
public Map.Entry<K, V>
lastEntry()

Implements java.util.NavigableMap.lastEntry.

Returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.
public K
lastKey()

Implements java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.
public Map.Entry<K, V>
lowerEntry(K
the key
key
)

Implements java.util.NavigableMap.lowerEntry.

Returns a key-value mapping associated with the greatest key strictly less than the given key, or null if there is no such key.
public K
lowerKey(K
the key
key
)

Implements java.util.NavigableMap.lowerKey.

Returns the greatest key strictly less than the given key, or null if there is no such key.
public Map.Entry<K, V>
pollFirstEntry()

Implements java.util.NavigableMap.pollFirstEntry.

Removes and returns a key-value mapping associated with the least key in this map, or null if the map is empty.
public Map.Entry<K, V>
pollLastEntry()

Implements java.util.NavigableMap.pollLastEntry.

Removes and returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.
public SortedMap<K, V>
subMap(K
low endpoint (inclusive) of the keys in the returned map
fromKey
,
K
high endpoint (exclusive) of the keys in the returned map
toKey
)

Implements java.util.NavigableMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.
public SortedMap<K, V>
tailMap(K
low endpoint (inclusive) of the keys in the returned map
fromKey
)

Implements java.util.NavigableMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey.
Inherited from com.google.common.collect.Maps.IteratorBasedAbstractMap:
clearentryIteratorentrySetentrySpliteratorforEachEntrysize

Constructor Detail

AbstractNavigableMapback to summary
pack-priv AbstractNavigableMap()

Method Detail

ceilingEntryback to summary
public Map.Entry<K, V> ceilingEntry(K key)

Implements java.util.NavigableMap.ceilingEntry.

Doc from java.util.NavigableMap.ceilingEntry.

Returns a key-value mapping associated with the least key greater than or equal to the given key, or null if there is no such key.

Parameters
key:K

the key

Returns:Map.Entry<K, V>

an entry with the least key greater than or equal to key, or null if there is no such key

Annotations
@Override
@CheckForNull
ceilingKeyback to summary
public K ceilingKey(K key)

Implements java.util.NavigableMap.ceilingKey.

Doc from java.util.NavigableMap.ceilingKey.

Returns the least key greater than or equal to the given key, or null if there is no such key.

Parameters
key:K

the key

Returns:K

the least key greater than or equal to key, or null if there is no such key

Annotations
@Override
@CheckForNull
descendingEntryIteratorback to summary
pack-priv abstract Iterator<Map.Entry<K, V>> descendingEntryIterator()
descendingKeySetback to summary
public NavigableSet<K> descendingKeySet()

Implements java.util.NavigableMap.descendingKeySet.

Doc from java.util.NavigableMap.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. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. 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.

Returns:NavigableSet<K>

a reverse order navigable set view of the keys in this map

Annotations
@Override
descendingMapback to summary
public NavigableMap<K, V> descendingMap()

Implements java.util.NavigableMap.descendingMap.

Doc from java.util.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. If either map is modified while an iteration over a collection view of either map is in progress (except through the iterator's own remove operation), the results of the iteration are undefined.

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.

Returns:NavigableMap<K, V>

a reverse order view of this map

Annotations
@Override
firstEntryback to summary
public Map.Entry<K, V> firstEntry()

Implements java.util.NavigableMap.firstEntry.

Doc from java.util.NavigableMap.firstEntry.

Returns a key-value mapping associated with the least key in this map, or null if the map is empty.

Returns:Map.Entry<K, V>

an entry with the least key, or null if this map is empty

Annotations
@Override
@CheckForNull
firstKeyback to summary
public K firstKey()

Implements java.util.SortedMap.firstKey.

Doc from java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

Returns:K

the first (lowest) key currently in this map

Annotations
@Override
@ParametricNullness
floorEntryback to summary
public Map.Entry<K, V> floorEntry(K key)

Implements java.util.NavigableMap.floorEntry.

Doc from java.util.NavigableMap.floorEntry.

Returns a key-value mapping associated with the greatest key less than or equal to the given key, or null if there is no such key.

Parameters
key:K

the key

Returns:Map.Entry<K, V>

an entry with the greatest key less than or equal to key, or null if there is no such key

Annotations
@Override
@CheckForNull
floorKeyback to summary
public K floorKey(K key)

Implements java.util.NavigableMap.floorKey.

Doc from java.util.NavigableMap.floorKey.

Returns the greatest key less than or equal to the given key, or null if there is no such key.

Parameters
key:K

the key

Returns:K

the greatest key less than or equal to key, or null if there is no such key

Annotations
@Override
@CheckForNull
getback to summary
public abstract V get(Object key)

Redeclares java.util.Map.get.

Overrides java.util.AbstractMap.get.

Doc from java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters
key:Object

the key whose associated value is to be returned

Returns:V

the value to which the specified key is mapped, or null if this map contains no mapping for the key

Annotations
@Override
@CheckForNull
headMapback to summary
public SortedMap<K, V> headMap(K toKey)

Implements java.util.NavigableMap.headMap.

Doc from java.util.NavigableMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Equivalent to headMap(toKey, false).

Parameters
toKey:K

Doc from java.util.SortedMap.headMap.

high endpoint (exclusive) of the keys in the returned map

Returns:SortedMap<K, V>

Doc from java.util.SortedMap.headMap.

a view of the portion of this map whose keys are strictly less than toKey

Annotations
@Override
higherEntryback to summary
public Map.Entry<K, V> higherEntry(K key)

Implements java.util.NavigableMap.higherEntry.

Doc from java.util.NavigableMap.higherEntry.

Returns a key-value mapping associated with the least key strictly greater than the given key, or null if there is no such key.

Parameters
key:K

the key

Returns:Map.Entry<K, V>

an entry with the least key greater than key, or null if there is no such key

Annotations
@Override
@CheckForNull
higherKeyback to summary
public K higherKey(K key)

Implements java.util.NavigableMap.higherKey.

Doc from java.util.NavigableMap.higherKey.

Returns the least key strictly greater than the given key, or null if there is no such key.

Parameters
key:K

the key

Returns:K

the least key greater than key, or null if there is no such key

Annotations
@Override
@CheckForNull
keySetback to summary
public Set<K> keySet()

Overrides java.util.AbstractMap.keySet.

Implements java.util.SortedMap.keySet, java.util.Map.keySet.

Doc from java.util.SortedMap.keySet.

Returns a Set 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. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. 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.

Returns:Set<K>

a set view of the keys contained in this map, sorted in ascending order

Annotations
@Override
lastEntryback to summary
public Map.Entry<K, V> lastEntry()

Implements java.util.NavigableMap.lastEntry.

Doc from java.util.NavigableMap.lastEntry.

Returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.

Returns:Map.Entry<K, V>

an entry with the greatest key, or null if this map is empty

Annotations
@Override
@CheckForNull
lastKeyback to summary
public K lastKey()

Implements java.util.SortedMap.lastKey.

Doc from java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

Returns:K

the last (highest) key currently in this map

Annotations
@Override
@ParametricNullness
lowerEntryback to summary
public Map.Entry<K, V> lowerEntry(K key)

Implements java.util.NavigableMap.lowerEntry.

Doc from java.util.NavigableMap.lowerEntry.

Returns a key-value mapping associated with the greatest key strictly less than the given key, or null if there is no such key.

Parameters
key:K

the key

Returns:Map.Entry<K, V>

an entry with the greatest key less than key, or null if there is no such key

Annotations
@Override
@CheckForNull
lowerKeyback to summary
public K lowerKey(K key)

Implements java.util.NavigableMap.lowerKey.

Doc from java.util.NavigableMap.lowerKey.

Returns the greatest key strictly less than the given key, or null if there is no such key.

Parameters
key:K

the key

Returns:K

the greatest key less than key, or null if there is no such key

Annotations
@Override
@CheckForNull
pollFirstEntryback to summary
public Map.Entry<K, V> pollFirstEntry()

Implements java.util.NavigableMap.pollFirstEntry.

Doc from java.util.NavigableMap.pollFirstEntry.

Removes and returns a key-value mapping associated with the least key in this map, or null if the map is empty.

Returns:Map.Entry<K, V>

the removed first entry of this map, or null if this map is empty

Annotations
@Override
@CheckForNull
pollLastEntryback to summary
public Map.Entry<K, V> pollLastEntry()

Implements java.util.NavigableMap.pollLastEntry.

Doc from java.util.NavigableMap.pollLastEntry.

Removes and returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.

Returns:Map.Entry<K, V>

the removed last entry of this map, or null if this map is empty

Annotations
@Override
@CheckForNull
subMapback to summary
public SortedMap<K, V> subMap(K fromKey, K toKey)

Implements java.util.NavigableMap.subMap.

Doc from java.util.NavigableMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. (If fromKey and toKey are equal, the returned map is empty.) The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Equivalent to subMap(fromKey, true, toKey, false).

Parameters
fromKey:K

Doc from java.util.SortedMap.subMap.

low endpoint (inclusive) of the keys in the returned map

toKey:K

Doc from java.util.SortedMap.subMap.

high endpoint (exclusive) of the keys in the returned map

Returns:SortedMap<K, V>

Doc from java.util.SortedMap.subMap.

a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive

Annotations
@Override
tailMapback to summary
public SortedMap<K, V> tailMap(K fromKey)

Implements java.util.NavigableMap.tailMap.

Doc from java.util.NavigableMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Equivalent to tailMap(fromKey, true).

Parameters
fromKey:K

Doc from java.util.SortedMap.tailMap.

low endpoint (inclusive) of the keys in the returned map

Returns:SortedMap<K, V>

Doc from java.util.SortedMap.tailMap.

a view of the portion of this map whose keys are greater than or equal to fromKey

Annotations
@Override
com.google.common.collect back to summary

private final Class AbstractNavigableMap.DescendingMap

extends Maps.DescendingMap<K extends @Nullable Object, V extends @Nullable Object>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv Iterator<Map.Entry<K, V>>
pack-priv NavigableMap<K, V>
Inherited from com.google.common.collect.Maps.DescendingMap:
ceilingEntryceilingKeycomparatorcreateEntrySetdelegatedescendingKeySetdescendingMapentrySetfirstEntryfirstKeyfloorEntryfloorKeyheadMapheadMaphigherEntryhigherKeykeySetlastEntrylastKeylowerEntrylowerKeynavigableKeySetpollFirstEntrypollLastEntrysubMapsubMaptailMaptailMaptoStringvalues

Constructor Detail

DescendingMapback to summary
private DescendingMap()

Method Detail

entryIteratorback to summary
pack-priv Iterator<Map.Entry<K, V>> entryIterator()

Implements abstract com.google.common.collect.Maps.DescendingMap.entryIterator.

Annotations
@Override
forwardback to summary
pack-priv NavigableMap<K, V> forward()

Implements abstract com.google.common.collect.Maps.DescendingMap.forward.

Annotations
@Override