SortedBidiMap to ensure it can't be altered.
Attempts to modify it will result in an UnsupportedOperationException.
| Modifier and Type | Field and Description |
|---|---|
| private UnmodifiableSortedBidiMap | inverse
The inverse unmodifiable map |
| Access | Constructor and Description |
|---|---|
| private | UnmodifiableSortedBidiMap(final SortedBidiMap<K, ? extends V>
the map to decorate, must not be null map)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Overrides org. Implements java. |
| public Set | entrySet()
Overrides org. Implements java. Set view of the mappings contained in this map.
|
| public SortedMap | headMap(final K
high endpoint (exclusive) of the keys in the returned map toKey)Overrides org. Implements java. toKey.
|
| public SortedBidiMap | inverseBidiMap()
Overrides org. Implements org. |
| public Set | keySet()
Overrides org. Implements java. Set view of the keys contained in this map.
|
| public OrderedMapIterator | mapIterator()
Overrides org. Implements org. OrderedMapIterator over the map.
|
| public V | put(final K
the key to store key, final V the value to store value)Overrides org. Implements org. |
| public void | putAll(final Map<? extends K, ? extends V>
mappings to be stored in this map mapToCopy)Overrides org. Implements java. |
| public V | remove(final Object
key whose mapping is to be removed from the map key)Overrides org. Implements java. |
| public K | removeValue(final Object
the value to find the key-value pair for value)Overrides org. Implements org. |
| public SortedMap | subMap(final K
low endpoint (inclusive) of the keys in the returned map fromKey, final K high endpoint (exclusive) of the keys in the returned map toKey)Overrides org. Implements java. fromKey, inclusive, to toKey, exclusive.
|
| public SortedMap | tailMap(final K
low endpoint (inclusive) of the keys in the returned map fromKey)Overrides org. Implements java. fromKey.
|
| public static < the key type K, the value type V> SortedBidiMap | Returns: an unmodifiable SortedBidiMapthe map to decorate, must not be null map)Factory method to create an unmodifiable map. |
| public Set | values()
Overrides org. Implements org. Collection view of the values contained in this map.
|
| inverse | back to summary |
|---|---|
| private UnmodifiableSortedBidiMap<V, K> inverse The inverse unmodifiable map | |
| UnmodifiableSortedBidiMap | back to summary |
|---|---|
| private UnmodifiableSortedBidiMap(final SortedBidiMap<K, ? extends V> map) Constructor that wraps (not copies).
| |
| clear | back to summary |
|---|---|
| public void clear() Overrides org. Implements java. Doc from java. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| entrySet | back to summary |
|---|---|
| public Set Overrides org. Implements java. Doc from java. Returns a | |
| headMap | back to summary |
|---|---|
| public SortedMap Overrides org. Implements java. Doc from java. Returns a view of the portion of this map whose keys are
strictly less than The returned map will throw an | |
| inverseBidiMap | back to summary |
|---|---|
| public SortedBidiMap Overrides org. 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 equally.
Implementations should seek to avoid creating a new object every time this
method is called. See
Implementations must return a
| |
| keySet | back to summary |
|---|---|
| public Set Overrides org. Implements java. Doc from java. Returns a | |
| mapIterator | back to summary |
|---|---|
| public OrderedMapIterator Overrides org. Implements org. Doc from org. Obtains an A ordered map iterator is an efficient way of iterating over maps in both directions.
| |
| put | back to summary |
|---|---|
| public V put(final K key, final V value) Overrides org. Implements org. Doc from org. Puts the key-value pair into the map, replacing any previous pair. When adding a key-value pair, the value may already exist in the map against a different key. That mapping is removed, to ensure that the value only occurs once in the inverse map.
BidiMap map1 = new DualHashBidiMap();
map.put("A","B"); // contains A mapped to B, as per Map
map.put("A","C"); // contains A mapped to C, as per Map
BidiMap map2 = new DualHashBidiMap();
map.put("A","B"); // contains A mapped to B, as per Map
map.put("C","B"); // contains C mapped to B, key A is removed
| |
| putAll | back to summary |
|---|---|
| public void putAll(final Map<? extends K, ? extends V> mapToCopy) Overrides org. Implements java. Doc from java. Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling | |
| remove | back to summary |
|---|---|
| public V remove(final Object key) Overrides org. Implements java. Doc from java. Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns. | |
| removeValue | back to summary |
|---|---|
| public K removeValue(final Object value) Overrides org. 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 | |
| subMap | back to summary |
|---|---|
| public SortedMap Overrides org. Implements java. Doc from java. Returns a view of the portion of this map whose keys range from
The returned map will throw an | |
| tailMap | back to summary |
|---|---|
| public SortedMap Overrides org. Implements java. Doc from java. Returns a view of the portion of this map whose keys are
greater than or equal to The returned map will throw an | |
| unmodifiableSortedBidiMap | back to summary |
|---|---|
| public static <K, V> SortedBidiMap Factory method to create an unmodifiable map. If the map passed in is already unmodifiable, it is returned.
| |
| values | back to summary |
|---|---|
| public Set Overrides org. Implements org. Doc from java. Returns a | |