org.apache.commons.collections.map
Class AbstractOrderedMapDecorator
- IterableMap, Map, OrderedMap
public abstract class AbstractOrderedMapDecorator
Provides a base decorator that enables additional functionality to be added
to an OrderedMap via decoration.
Methods are forwarded directly to the decorated map.
This implementation does not perform any special processing with the map views.
Instead it simply returns the set/collection from the wrapped map. This may be
undesirable, for example if you are trying to write a validating implementation
it would provide a loophole around the validation.
But, you might want that loophole, so this class is kept simple.
$Revision: 1.7 $ $Date: 2004/04/02 21:17:48 $
clear , containsKey , containsValue , entrySet , equals , get , getMap , hashCode , isEmpty , keySet , put , putAll , remove , size , toString , values |
AbstractOrderedMapDecorator
protected AbstractOrderedMapDecorator()
Constructor only used in deserialization, do not use otherwise.
AbstractOrderedMapDecorator
public AbstractOrderedMapDecorator(OrderedMap map)
Constructor that wraps (not copies).
map
- the map to decorate, must not be null
getOrderedMap
protected OrderedMap getOrderedMap()
Gets the map being decorated.
mapIterator
public MapIterator mapIterator()
Obtains a
MapIterator
over the map.
A map iterator is an efficient way of iterating over maps.
There is no need to access the entry set or cast to Map Entry objects.
IterableMap map = new HashedMap();
MapIterator it = map.mapIterator();
while (it.hasNext()) {
Object key = it.next();
Object value = it.getValue();
it.setValue("newValue");
}
- mapIterator in interface IterableMap
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.