net.cscott.jutil
Class GenericInvertibleMap<K,V>
java.lang.Object
net.cscott.jutil.MapWrapper<K,V>
net.cscott.jutil.GenericInvertibleMap<K,V>
- All Implemented Interfaces:
- Map<K,V>, InvertibleMap<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.5 2006-10-30 19:58:05 cananian Exp $
- Author:
- Felix S. Klock II
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from class net.cscott.jutil.MapWrapper |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, size, toString, values |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, size, values |
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)
wrapped
protected Map<K,V> wrapped()
- Specified by:
wrapped
in class MapWrapper<K,V>
invert
public MultiMap<V,K> invert()
- Returns an unmodifiable inverted view of
this
.
- Specified by:
invert
in interface InvertibleMap<K,V>
put
public V put(K key,
V value)
- Specified by:
put
in interface Map<K,V>
- Overrides:
put
in class MapWrapper<K,V>
putAll
public void putAll(Map<? extends K,? extends V> m)
- Specified by:
putAll
in interface Map<K,V>
- Overrides:
putAll
in class MapWrapper<K,V>
remove
public V remove(Object key)
- Specified by:
remove
in interface Map<K,V>
- Overrides:
remove
in class MapWrapper<K,V>
Copyright (c) 2006 C. Scott Ananian