Save This Page
Home » commons-collections-3.2.1-src » org.apache.commons » collections » [javadoc | source]
org.apache.commons.collections
public interface: OrderedMap [javadoc | source]

All Implemented Interfaces:
    IterableMap

All Known Implementing Classes:
    LRUMap, AbstractSortedBidiMapDecorator, AbstractLinkedMap, MockLRUMapSubclass, TreeBidiMap, ListOrderedMap, TestOrderedBidiMap, AbstractOrderedBidiMapDecorator, UnmodifiableOrderedMap, SortedBidiMap, SingletonMap, AbstractOrderedMapDecorator, MockLRUMapSubclassFirstBlocksRemove, MockLRUMapSubclassBlocksRemove, OrderedBidiMap, UnmodifiableOrderedBidiMap, Inverse, UnmodifiableSortedBidiMap, LinkedMap, DualTreeBidiMap

Defines a map that maintains order and allows both forward and backward iteration through that order.
Method from org.apache.commons.collections.OrderedMap Summary:
firstKey,   lastKey,   nextKey,   orderedMapIterator,   previousKey
Method from org.apache.commons.collections.OrderedMap Detail:
 public Object firstKey()
    Gets the first key currently in this map.
 public Object lastKey()
    Gets the last key currently in this map.
 public Object nextKey(Object key)
    Gets the next key after the one specified.
 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();
    }
    
 public Object previousKey(Object key)
    Gets the previous key before the one specified.