java.util.Map<K,V>
, java.util.SortedMap<K,V>
, BidiMap<K,V>
, Get<K,V>
, IterableGet<K,V>
, IterableMap<K,V>
, OrderedBidiMap<K,V>
, OrderedMap<K,V>
, Put<K,V>
, SortedBidiMap<K,V>
UnmodifiableSortedBidiMap
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 | Description |
---|---|
AbstractSortedBidiMapDecorator(SortedBidiMap<K,V> map) |
Constructor that wraps (not copies).
|
Modifier and Type | Method | Description |
---|---|---|
java.util.Comparator<? super K> |
comparator() |
|
protected SortedBidiMap<K,V> |
decorated() |
Gets the map being decorated.
|
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.
|
getKey, removeValue, values
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString
firstKey, lastKey, mapIterator, nextKey, previousKey
getKey, put, removeValue, values
containsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entry, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, of, of, of, of, of, of, of, of, of, of, of, ofEntries, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
firstKey, lastKey, mapIterator, nextKey, previousKey
public AbstractSortedBidiMapDecorator(SortedBidiMap<K,V> map)
map
- the map to decorate, must not be nulljava.lang.NullPointerException
- if the collection is nullprotected SortedBidiMap<K,V> decorated()
decorated
in class AbstractOrderedBidiMapDecorator<K,V>
public 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 © 2001-2019 - Apache Software Foundation