org.apache.commons.collections.bidimap
Class AbstractBidiMapDecorator
- BidiMap, IterableMap, Map
public abstract class AbstractBidiMapDecorator
Provides a base decorator that enables additional functionality to be added
to a BidiMap 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.5 $ $Date: 2004/02/18 00:57:39 $
clear , containsKey , containsValue , entrySet , equals , get , getMap , hashCode , isEmpty , keySet , put , putAll , remove , size , toString , values |
AbstractBidiMapDecorator
protected AbstractBidiMapDecorator(BidiMap map)
Constructor that wraps (not copies).
map
- the map to decorate, must not be null
getBidiMap
protected BidiMap getBidiMap()
Gets the map being decorated.
getKey
public Object getKey(Object value)
- getKey in interface BidiMap
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 BidiMap
- mapIterator in interface IterableMap
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.