org.apache.commons.collections
Interface OrderedMap

public interface OrderedMap
extends IterableMap
Defines a map that maintains order and allows both forward and backward iteration through that order.
SinceCommons Co
Version$Revision:
AuthorStephen Colebourne
Wiki javadoc Use textile entry format.
Add your comments here.
Method Summary
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.
Methods inherited from org.apache.commons.collectionsIterableMap
firstKey
public Object firstKey ( )
Gets the first key currently in this map.
Wiki javadoc Use textile entry format.
Add your comments here.
lastKey
public Object lastKey ( )
Gets the last key currently in this map.
Wiki javadoc Use textile entry format.
Add your comments here.
nextKey
public Object nextKey ( Object key )
Gets the next key after the one specified.
Parameters
TypeNameDescription
Object key the key to search for next from
Wiki javadoc Use textile entry format.
Add your comments here.
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();
 }
 
Wiki javadoc Use textile entry format.
Add your comments here.
previousKey
public Object previousKey ( Object key )
Gets the previous key before the one specified.
Parameters
TypeNameDescription
Object key the key to search for previous from
Wiki javadoc Use textile entry format.
Add your comments here.