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 |
---|---|
java.util.Comparator |
comparator() |
protected SortedBidiMap |
getSortedBidiMap()
Gets the map being decorated.
|
java.util.SortedMap |
headMap(java.lang.Object toKey) |
SortedBidiMap |
inverseSortedBidiMap()
Gets a view of this map where the keys and values are reversed.
|
java.util.SortedMap |
subMap(java.lang.Object fromKey,
java.lang.Object toKey) |
java.util.SortedMap |
tailMap(java.lang.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 nulljava.lang.IllegalArgumentException
- 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 java.util.Comparator comparator()
comparator
in interface java.util.SortedMap
public java.util.SortedMap subMap(java.lang.Object fromKey, java.lang.Object toKey)
subMap
in interface java.util.SortedMap
public java.util.SortedMap headMap(java.lang.Object toKey)
headMap
in interface java.util.SortedMap
public java.util.SortedMap tailMap(java.lang.Object fromKey)
tailMap
in interface java.util.SortedMap
Copyright © 2001-2024 Apache Software Foundation. All Rights Reserved.