public abstract class AbstractSortedBidiMapDecorator extends AbstractOrderedBidiMapDecorator implements SortedBidiMap
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 inverse 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.
map
Constructor and Description |
---|
AbstractSortedBidiMapDecorator(SortedBidiMap map)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
Comparator |
comparator() |
protected SortedBidiMap |
getSortedBidiMap()
Gets the map being decorated.
|
SortedMap |
headMap(Object toKey) |
SortedBidiMap |
inverseSortedBidiMap()
Gets a view of this map where the keys and values are reversed.
|
SortedMap |
subMap(Object fromKey,
Object toKey) |
SortedMap |
tailMap(Object fromKey) |
firstKey, getOrderedBidiMap, inverseOrderedBidiMap, lastKey, nextKey, orderedMapIterator, previousKey
getBidiMap, getKey, inverseBidiMap, mapIterator, removeValue
clear, containsKey, containsValue, entrySet, equals, get, getMap, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
inverseBidiMap
inverseOrderedBidiMap
getKey, mapIterator, put, removeValue
firstKey, lastKey, nextKey, orderedMapIterator, previousKey
public AbstractSortedBidiMapDecorator(SortedBidiMap map)
map
- the map to decorate, must not be nullIllegalArgumentException
- if the collection is nullprotected SortedBidiMap getSortedBidiMap()
public SortedBidiMap inverseSortedBidiMap()
SortedBidiMap
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 SortedMap
.
Implementations should seek to avoid creating a new object every time this
method is called. See AbstractMap.values()
etc. Calling this
method on the inverse map should return the original.
The inverse map returned by inverseBidiMap()
should be the
same object as returned by this method.
inverseSortedBidiMap
in interface SortedBidiMap
public Comparator comparator()
comparator
in interface SortedMap
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.