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.
| Access | Constructor and Description |
|---|---|
| protected | AbstractBidiMapDecorator(final BidiMap<K, V>
the map to decorate, must not be null map)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| protected BidiMap | Returns: the decorated mapOverrides org. |
| public K | getKey(final Object
the value to find the key for value)Implements org. |
| public BidiMap | inverseBidiMap()
Implements org. |
| public MapIterator | mapIterator()
Overrides org. Implements org. MapIterator over the map.
|
| public K | removeValue(final Object
the value to find the key-value pair for value)Implements org. |
| public Set | values()
Overrides org. Implements org. Set view of the values contained in this map.
|
| AbstractBidiMapDecorator | back to summary |
|---|---|
| protected AbstractBidiMapDecorator(final BidiMap<K, V> map) Constructor that wraps (not copies).
| |
| decorated | back to summary |
|---|---|
| protected BidiMap Overrides org. Gets the map being decorated. | |
| getKey | back to summary |
|---|---|
| public K getKey(final Object value) Implements org. Doc from org. Gets the key that is currently mapped to the specified value.
If the value is not contained in the map,
Implementations should seek to make this method perform equally as well
as | |
| inverseBidiMap | back to summary |
|---|---|
| public BidiMap Implements org. Doc from org. Gets a view of this map where the keys and values are reversed.
Changes to one map will be visible in the other and vice versa.
This enables both directions of the map to be accessed as a
Implementations should seek to avoid creating a new object every time this
method is called. See | |
| mapIterator | back to summary |
|---|---|
| public MapIterator Overrides org. Implements org. Doc from org. Obtains a A map iterator is an efficient way of iterating over maps. There is no need to access the entry set or use Map Entry objects.
IterableMap<String,Integer> map = new HashedMap<String,Integer>();
MapIterator<String,Integer> it = map.mapIterator();
while (it.hasNext()) {
String key = it.next();
Integer value = it.getValue();
it.setValue(value + 1);
}
| |
| removeValue | back to summary |
|---|---|
| public K removeValue(final Object value) Implements org. Doc from org. Removes the key-value pair that is currently mapped to the specified value (optional operation).
If the value is not contained in the map,
Implementations should seek to make this method perform equally as well
as | |
| values | back to summary |
|---|---|
| public Set Overrides org. Implements org. Doc from org. Returns a | |