public interface OrderedMap extends IterableMap
Modifier and Type | Method and Description |
---|---|
Object |
firstKey()
Gets the first key currently in this map.
|
Object |
lastKey()
Gets the last key currently in this map.
|
Object |
nextKey(Object key)
Gets the next key after the one specified.
|
OrderedMapIterator |
orderedMapIterator()
Obtains an
OrderedMapIterator over the map. |
Object |
previousKey(Object key)
Gets the previous key before the one specified.
|
mapIterator
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
OrderedMapIterator orderedMapIterator()
OrderedMapIterator
over the map.
A ordered map iterator is an efficient way of iterating over maps in both directions.
BidiMap map = new TreeBidiMap(); MapIterator it = map.mapIterator(); while (it.hasNext()) { Object key = it.next(); Object value = it.getValue(); it.setValue("newValue"); Object previousKey = it.previous(); }
Object firstKey()
NoSuchElementException
- if this map is emptyObject lastKey()
NoSuchElementException
- if this map is emptyObject nextKey(Object key)
key
- the key to search for next fromCopyright © 2001–2014 The Apache Software Foundation. All rights reserved.