coins.flow
Class ListValuedMap

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended bycoins.flow.ListValuedMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class ListValuedMap
extends java.util.HashMap

Map a key to a list of objects.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.HashMap
 
Nested classes inherited from class java.util.AbstractMap
 
Field Summary
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
ListValuedMap()
          Creates a new instance of ListValuedMap
 
Method Summary
 boolean addUnique(java.lang.Object pKey, java.lang.Object pNewEntry)
          Add pNewEntry to the list corresponding to pKey.
 java.lang.Object get(java.lang.Object pKey)
          Get the list corresponding to the key pKey.
 boolean removeAllEntries(java.lang.Object pKey)
           
 boolean removeIfContained(java.lang.Object pKey, java.lang.Object pEntry)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ListValuedMap

public ListValuedMap()
Creates a new instance of ListValuedMap

Method Detail

get

public java.lang.Object get(java.lang.Object pKey)
Get the list corresponding to the key pKey. If pKey is not contained in the map, then add pKey as a new key having an empty list.

Returns:
the list corresponding to pKey.

addUnique

public boolean addUnique(java.lang.Object pKey,
                         java.lang.Object pNewEntry)
Add pNewEntry to the list corresponding to pKey. If the list already contains pNewEntry then addition is not done and false is returned.

Returns:
true if added, false if not added (already cantained).

removeIfContained

public boolean removeIfContained(java.lang.Object pKey,
                                 java.lang.Object pEntry)

removeAllEntries

public boolean removeAllEntries(java.lang.Object pKey)