org.apache.commons.collections
Interface OrderedMap
- IterableMap, Map
- OrderedBidiMap, SortedBidiMap
- AbstractLinkedMap, AbstractOrderedBidiMapDecorator, AbstractOrderedMapDecorator, AbstractSortedBidiMapDecorator, DualTreeBidiMap, LinkedMap, ListOrderedMap, LRUMap, SingletonMap, TreeBidiMap, UnmodifiableOrderedBidiMap, UnmodifiableOrderedMap, UnmodifiableSortedBidiMap
public interface OrderedMap
Defines a map that maintains order and allows both forward and backward
iteration through that order.
$Revision: 1.6 $ $Date: 2004/02/18 01:15:42 $ 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.
|
firstKey
public Object firstKey()
Gets the first key currently in this map.
- the first key currently in this map
lastKey
public Object lastKey()
Gets the last key currently in this map.
- the last key currently in this map
nextKey
public Object nextKey(Object key)
Gets the next key after the one specified.
key
- the key to search for next from
- the next key, null if no match or at end
orderedMapIterator
public OrderedMapIterator orderedMapIterator()
Obtains an
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();
}
previousKey
public Object previousKey(Object key)
Gets the previous key before the one specified.
key
- the key to search for previous from
- the previous key, null if no match or at start
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.