|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Defines a map that maintains order and allows both forward and backward iteration through that order.
| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Method Summary | |
java.lang.Object |
firstKey()
Gets the first key currently in this map. |
java.lang.Object |
lastKey()
Gets the last key currently in this map. |
java.lang.Object |
nextKey(java.lang.Object key)
Gets the next key after the one specified. |
OrderedMapIterator |
orderedMapIterator()
Obtains an OrderedMapIterator over the map. |
java.lang.Object |
previousKey(java.lang.Object key)
Gets the previous key before the one specified. |
| Methods inherited from interface org.apache.commons.collections.IterableMap |
mapIterator |
| Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Method Detail |
public 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();
}
public java.lang.Object firstKey()
java.util.NoSuchElementException - if this map is emptypublic java.lang.Object lastKey()
java.util.NoSuchElementException - if this map is emptypublic java.lang.Object nextKey(java.lang.Object key)
key - the key to search for next from
public java.lang.Object previousKey(java.lang.Object key)
key - the key to search for previous from
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||