net.cscott.jutil

Class GenericInvertibleMap<K,V>

public class GenericInvertibleMap<K,V> extends MapWrapper<K,V> implements InvertibleMap<K,V>

GenericInvertibleMap is a default implementation of InvertibleMap. It returns unmodifiable inverted views of the mappings it maintains.

Version: $Id: GenericInvertibleMap.java,v 1.2 2004/01/13 20:47:05 cananian Exp $

Author: Felix S. Klock II

Constructor Summary
GenericInvertibleMap()
Constructs an invertible map backed by a HashMap.
GenericInvertibleMap(MapFactory<K,V> mf, MultiMapFactory<V,K> mmf)
Constructs an invertible map backed by a map constructed by mf and an inverted map constructed by mmf.
GenericInvertibleMap(Map<K,V> m)
Method Summary
MultiMap<V,K>invert()
Returns an unmodifiable inverted view of this.
Vput(K key, V value)
voidputAll(Map<? extends K,? extends V> m)
Vremove(Object key)

Constructor Detail

GenericInvertibleMap

public GenericInvertibleMap()
Constructs an invertible map backed by a HashMap.

GenericInvertibleMap

public GenericInvertibleMap(MapFactory<K,V> mf, MultiMapFactory<V,K> mmf)
Constructs an invertible map backed by a map constructed by mf and an inverted map constructed by mmf.

GenericInvertibleMap

public GenericInvertibleMap(Map<K,V> m)

Method Detail

invert

public MultiMap<V,K> invert()
Returns an unmodifiable inverted view of this.

put

public V put(K key, V value)

putAll

public void putAll(Map<? extends K,? extends V> m)

remove

public V remove(Object key)
Copyright © 2003 C. Scott Ananian