common
Class IndexedHashMultiMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by common.HashMultiMap
          extended by common.IndexedHashMultiMap
All Implemented Interfaces:
IndexedMultiMap, MultiMap, java.lang.Cloneable, java.util.Map

public class IndexedHashMultiMap
extends HashMultiMap
implements IndexedMultiMap

Implementation of the IndexedMultiMap interface.


Nested Class Summary
protected  class IndexedHashMultiMap.IndexedValueSet
           
 
Nested classes/interfaces inherited from class common.HashMultiMap
HashMultiMap.ValueSet
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface common.IndexedMultiMap
IndexedMultiMap.EmptyIndexedMultiMap
 
Nested classes/interfaces inherited from interface common.MultiMap
MultiMap.EmptyMultiMap
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class common.HashMultiMap
maintainOrder, map
 
Fields inherited from interface common.IndexedMultiMap
EMPTY_INDEXED_MULTI_MAP
 
Fields inherited from interface common.MultiMap
EMPTY_MULTI_MAP
 
Constructor Summary
IndexedHashMultiMap()
          Creates a new, empty IndexedMultiMap.
IndexedHashMultiMap(IndexedMultiMap orig)
          Creates a new IndexedMultiMap that is initially equal to the given IndexedMultiMap.
 
Method Summary
protected  java.util.Set copySet(java.util.Set orig)
           
protected  java.util.Set emptySet()
           
 java.lang.Object get(java.lang.Object key)
          Returns the set associated with the given key.
protected  java.util.Set newSet()
           
 
Methods inherited from class common.HashMultiMap
add, addAll, clear, clone, containsKey, containsValue, entrySet, equals, hashCode, keySet, put, remove, remove, removeAll, size
 
Methods inherited from class java.util.AbstractMap
isEmpty, putAll, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface common.MultiMap
add, addAll, put, remove, removeAll
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values
 

Constructor Detail

IndexedHashMultiMap

public IndexedHashMultiMap()
Creates a new, empty IndexedMultiMap.


IndexedHashMultiMap

public IndexedHashMultiMap(IndexedMultiMap orig)
Creates a new IndexedMultiMap that is initially equal to the given IndexedMultiMap.

Method Detail

get

public java.lang.Object get(java.lang.Object key)
Description copied from interface: MultiMap
Returns the set associated with the given key. If the key is not in the map, returns an empty set. The set returned is modifiable and backed by this multi-map: if values are added for the given key, they will show up in the returned set. However, the returned set may lose its connection to this multi-map if the multi-map's put method is called or if all the values for the given key are removed.

Specified by:
get in interface MultiMap
Specified by:
get in interface java.util.Map
Overrides:
get in class HashMultiMap

emptySet

protected java.util.Set emptySet()
Overrides:
emptySet in class HashMultiMap

newSet

protected java.util.Set newSet()
Overrides:
newSet in class HashMultiMap

copySet

protected java.util.Set copySet(java.util.Set orig)
Overrides:
copySet in class HashMultiMap