java.lang.Object | +--org.apache.commons.collections.map.AbstractMapDecorator | +--org.apache.commons.collections.map.ListOrderedMapAll Implemented Interfaces:
List | Internal list to hold the sequence of objects |
ListOrderedMap(Map map) Constructor that wraps (not copies). |
List | asList() Gets an unmodifiable List view of the keys which changes as the map changes. |
void | clear() |
static OrderedMap | decorate(Map map) Factory method to create an ordered map. |
Set | entrySet() |
Object | firstKey() Gets the first key in this map by insert order. |
Object | get(int index) Gets the key at the specified index. |
Object | getValue(int index) Gets the value at the specified index. |
int | indexOf(Object key) Gets the index of the specified key. |
Set | keySet() |
Object | lastKey() Gets the last key in this map by insert order. |
Object | nextKey(Object key) Gets the next key to the one specified using insert order. |
Object | previousKey(Object key) Gets the previous key to the one specified using insert order. |
Object | put(Object key, Object value) |
void | putAll(Map map) |
Object | remove(Object key) |
Object | remove(int index) Removes the element at the specified index. |
String | toString() Returns the Map as a string. |
Collection | values() |
protected final List insertOrder
protected ListOrderedMap(Map map)
- if map is nullpublic List asList()
keySet()
public void clear()
public static OrderedMap decorate(Map map)
ArrayList
is used to retain order.
- if map is nullpublic Set entrySet()
public Object firstKey()
- if this map is emptypublic Object get(int index)
- if the index is invalidpublic Object getValue(int index)
- if the index is invalidpublic int indexOf(Object key)
public Set keySet()
public Object lastKey()
- if this map is emptypublic MapIterator mapIterator()
public Object nextKey(Object key)
public OrderedMapIterator orderedMapIterator()
public Object previousKey(Object key)
public Object put(Object key, Object value)
public void putAll(Map map)
public Object remove(int index)
- if the index is invalidpublic Object remove(Object key)
public String toString()
public Collection values()
Map
to ensure that the order of addition is retained. The order will be used via the iterators and toArray methods on the views. The order is also returned by theMapIterator
. TheorderedMapIterator()
method accesses an iterator that can iterate both forwards and backwards through the map. In addition, non-interface methods are provided to access the map by index. If an object is added to the Map for a second time, it will remain in the original position in the iteration.