|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.collections15.map.AbstractMapDecorator<K,V>
org.apache.commons.collections15.bidimap.AbstractBidiMapDecorator<K,V>
org.apache.commons.collections15.bidimap.AbstractOrderedBidiMapDecorator<K,V>
org.apache.commons.collections15.bidimap.AbstractSortedBidiMapDecorator<K,V>
org.apache.commons.collections15.bidimap.UnmodifiableSortedBidiMap<K,V>
public final class UnmodifiableSortedBidiMap<K,V>
Decorates another SortedBidiMap to ensure it can't be altered.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.collections15.map.AbstractMapDecorator |
|---|
map |
| Method Summary | ||
|---|---|---|
void |
clear()
|
|
static
|
decorate(SortedBidiMap<K,V> map)
Factory method to create an unmodifiable map. |
|
Set<Map.Entry<K,V>> |
entrySet()
|
|
SortedMap<K,V> |
headMap(K toKey)
|
|
BidiMap<V,K> |
inverseBidiMap()
Gets a view of this map where the keys and values are reversed. |
|
OrderedBidiMap<V,K> |
inverseOrderedBidiMap()
Gets a view of this map where the keys and values are reversed. |
|
SortedBidiMap<V,K> |
inverseSortedBidiMap()
Gets a view of this map where the keys and values are reversed. |
|
Set<K> |
keySet()
|
|
MapIterator<K,V> |
mapIterator()
Obtains a MapIterator over the map. |
|
OrderedMapIterator<K,V> |
orderedMapIterator()
Obtains an OrderedMapIterator over the map. |
|
V |
put(K key,
V value)
Puts the key-value pair into the map, replacing any previous pair. |
|
void |
putAll(Map<? extends K,? extends V> mapToCopy)
|
|
V |
remove(Object key)
|
|
K |
removeValue(Object value)
Removes the key-value pair that is currently mapped to the specified value (optional operation). |
|
SortedMap<K,V> |
subMap(K fromKey,
K toKey)
|
|
SortedMap<K,V> |
tailMap(K fromKey)
|
|
Set<V> |
values()
Returns a set view of the values contained in this BidiMap. |
|
| Methods inherited from class org.apache.commons.collections15.bidimap.AbstractSortedBidiMapDecorator |
|---|
comparator, getSortedBidiMap |
| Methods inherited from class org.apache.commons.collections15.bidimap.AbstractOrderedBidiMapDecorator |
|---|
firstKey, getOrderedBidiMap, lastKey, nextKey, previousKey |
| Methods inherited from class org.apache.commons.collections15.bidimap.AbstractBidiMapDecorator |
|---|
getBidiMap, getKey |
| Methods inherited from class org.apache.commons.collections15.map.AbstractMapDecorator |
|---|
containsKey, containsValue, equals, get, getMap, hashCode, isEmpty, size, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.commons.collections15.BidiMap |
|---|
getKey |
| Methods inherited from interface java.util.Map |
|---|
containsKey, containsValue, equals, get, hashCode, isEmpty, size |
| Methods inherited from interface org.apache.commons.collections15.OrderedMap |
|---|
firstKey, lastKey, nextKey, previousKey |
| Methods inherited from interface java.util.Map |
|---|
containsKey, containsValue, equals, get, hashCode, isEmpty, size |
| Methods inherited from interface java.util.SortedMap |
|---|
firstKey, lastKey |
| Method Detail |
|---|
public static <K,V> SortedBidiMap<K,V> decorate(SortedBidiMap<K,V> map)
map - the map to decorate, must not be null
IllegalArgumentException - if map is nullpublic void clear()
clear in interface Map<K,V>clear in class AbstractMapDecorator<K,V>
public V put(K key,
V value)
BidiMap
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
put in interface Map<K,V>put in interface BidiMap<K,V>put in class AbstractMapDecorator<K,V>key - the key to storevalue - the value to store
public void putAll(Map<? extends K,? extends V> mapToCopy)
putAll in interface Map<K,V>putAll in class AbstractMapDecorator<K,V>public V remove(Object key)
remove in interface Map<K,V>remove in class AbstractMapDecorator<K,V>public Set<Map.Entry<K,V>> entrySet()
entrySet in interface Map<K,V>entrySet in class AbstractMapDecorator<K,V>public Set<K> keySet()
keySet in interface Map<K,V>keySet in class AbstractMapDecorator<K,V>public Set<V> values()
BidiMap
values in interface Map<K,V>values in interface BidiMap<K,V>values in class AbstractBidiMapDecorator<K,V>public K removeValue(Object value)
BidiMapnull is returned.
Implementations should seek to make this method perform equally as well
as remove(Object).
removeValue in interface BidiMap<K,V>removeValue in class AbstractBidiMapDecorator<K,V>value - the value to find the key-value pair for
null if nothing removedpublic MapIterator<K,V> mapIterator()
BidiMapMapIterator over the map.
A map iterator is an efficient way of iterating over maps.
It does not require that the map is stored using Map Entry objects
which can increase performance.
BidiMap map = new DualHashBidiMap();
MapIterator it = map.mapIterator();
while (it.hasNext()) {
Object key = it.next();
Object value = it.getValue();
it.setValue("newValue");
}
mapIterator in interface BidiMap<K,V>mapIterator in interface IterableMap<K,V>mapIterator in class AbstractBidiMapDecorator<K,V>public BidiMap<V,K> inverseBidiMap()
BidiMapMap.
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 AbstractBidiMapDecorator<K,V>public OrderedMapIterator<K,V> orderedMapIterator()
OrderedMapOrderedMapIterator over the map.
A ordered map iterator is an efficient way of iterating over maps
in both directions.
BidiMap map = new TreeBidiMap();
MapIterator it = map.mapIterator();
while (it.hasNext()) {
Object key = it.next();
Object value = it.getValue();
it.setValue("newValue");
Object previousKey = it.previous();
}
orderedMapIterator in interface OrderedMap<K,V>orderedMapIterator in class AbstractOrderedBidiMapDecorator<K,V>public OrderedBidiMap<V,K> inverseOrderedBidiMap()
OrderedBidiMapAbstractMap.values() etc. Calling this
method on the inverse map should return the original.
inverseOrderedBidiMap in interface OrderedBidiMap<K,V>inverseOrderedBidiMap in class AbstractOrderedBidiMapDecorator<K,V>public SortedBidiMap<V,K> inverseSortedBidiMap()
SortedBidiMapSortedMap.
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<K,V>inverseSortedBidiMap in class AbstractSortedBidiMapDecorator<K,V>
public SortedMap<K,V> subMap(K fromKey,
K toKey)
subMap in interface SortedMap<K,V>subMap in class AbstractSortedBidiMapDecorator<K,V>public SortedMap<K,V> headMap(K toKey)
headMap in interface SortedMap<K,V>headMap in class AbstractSortedBidiMapDecorator<K,V>public SortedMap<K,V> tailMap(K fromKey)
tailMap in interface SortedMap<K,V>tailMap in class AbstractSortedBidiMapDecorator<K,V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||