public abstract class AbstractSortedBidiMapDecorator<K,V> extends AbstractOrderedBidiMapDecorator<K,V> implements SortedBidiMap<K,V>
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.
Constructor and Description |
---|
AbstractSortedBidiMapDecorator(SortedBidiMap<K,V> map)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
java.util.Comparator<? super K> |
comparator() |
java.util.SortedMap<K,V> |
headMap(K toKey) |
SortedBidiMap<V,K> |
inverseBidiMap()
Gets a view of this map where the keys and values are reversed.
|
java.util.SortedMap<K,V> |
subMap(K fromKey,
K toKey) |
java.util.SortedMap<K,V> |
tailMap(K fromKey) |
java.util.Comparator<? super V> |
valueComparator()
Get the comparator used for the values in the value-to-key map aspect.
|
firstKey, lastKey, mapIterator, nextKey, previousKey
getKey, removeValue, values
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString
getKey, put, removeValue, values
firstKey, lastKey, mapIterator, nextKey, previousKey
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
containsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size
public AbstractSortedBidiMapDecorator(SortedBidiMap<K,V> map)
map
- the map to decorate, must not be nulljava.lang.NullPointerException
- if the collection is nullpublic SortedBidiMap<V,K> inverseBidiMap()
BidiMap
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 Map
.
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.
inverseBidiMap
in interface BidiMap<K,V>
inverseBidiMap
in interface OrderedBidiMap<K,V>
inverseBidiMap
in interface SortedBidiMap<K,V>
inverseBidiMap
in class AbstractOrderedBidiMapDecorator<K,V>
public java.util.Comparator<? super K> comparator()
public java.util.Comparator<? super V> valueComparator()
SortedBidiMap
valueComparator
in interface SortedBidiMap<K,V>
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"