PIP.Collections
Class MultiMap<K,V extends java.util.Collection>

java.lang.Object
  extended by PIP.Collections.Persistent.AbstractMap<K,V>
      extended by PIP.Collections.MultiMap<K,V>
All Implemented Interfaces:
java.io.Serializable, java.util.Map<K,V>

public class MultiMap<K,V extends java.util.Collection>
extends AbstractMap<K,V>
implements java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
MultiMap()
           
MultiMap(org.apache.commons.collections.Factory f)
           
 
Method Summary
 java.util.Set<java.util.Map.Entry<K,V>> entrySet()
          Returns a set view of the mappings contained in this map.
 V get(java.lang.Object key)
          Returns the value to which this map maps the specified key.
 
Methods inherited from class PIP.Collections.Persistent.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiMap

public MultiMap()

MultiMap

public MultiMap(org.apache.commons.collections.Factory f)
Method Detail

entrySet

public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
Description copied from class: AbstractMap
Returns a set view of the mappings contained in this map. Each element in this set is a Map.Entry. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. (If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.) The set supports element removal, which removes the corresponding entry from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Specified by:
entrySet in interface java.util.Map<K,V extends java.util.Collection>
Specified by:
entrySet in class AbstractMap<K,V extends java.util.Collection>
Returns:
a set view of the mappings contained in this map.

get

public V get(java.lang.Object key)
Description copied from class: AbstractMap
Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

This implementation iterates over entrySet() searching for an entry with the specified key. If such an entry is found, the entry's value is returned. If the iteration terminates without finding such an entry, null is returned. Note that this implementation requires linear time in the size of the map; many implementations will override this method.

Specified by:
get in interface java.util.Map<K,V extends java.util.Collection>
Overrides:
get in class AbstractMap<K,V extends java.util.Collection>
Parameters:
key - key whose associated value is to be returned.
Returns:
the value to which this map maps the specified key.
See Also:
AbstractMap.containsKey(Object)