vitro.util
Class ReversibleMap<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by vitro.util.ObservableMap<K,V>
          extended by vitro.util.ReversibleMap<K,V>
All Implemented Interfaces:
Map<K,V>, ObservableCollection<Map.Entry<K,V>>

public class ReversibleMap<K,V>
extends ObservableMap<K,V>

ReversibleMap provides a convenient way to maintain a two-way map between keys and values.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
ReversibleMap()
          Create a new, empty Map.
ReversibleMap(Map<? extends K,? extends V> c)
          Create a new Map with the same elements as another Map.
 
Method Summary
 ReversibleMap<V,K> reverse()
          Obtain a reference to this Map's inverse.
 
Methods inherited from class vitro.util.ObservableMap
addObserver, entrySet, put, store
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReversibleMap

public ReversibleMap()
Create a new, empty Map.


ReversibleMap

public ReversibleMap(Map<? extends K,? extends V> c)
Create a new Map with the same elements as another Map.

Parameters:
c - the source Map.
Method Detail

reverse

public ReversibleMap<V,K> reverse()
Obtain a reference to this Map's inverse.