se.chalmers.cs.gf.util
Class MultiMap<K,V>

java.lang.Object
  extended by se.chalmers.cs.gf.util.MultiMap<K,V>
Type Parameters:
K - The type of the keys
V - The type of the values.

public class MultiMap<K,V>
extends java.lang.Object

Maps keys to sets of values.


Constructor Summary
MultiMap()
           
 
Method Summary
 boolean containsKey(K key)
          Checks whether there is at least one value for the given key.
 java.util.Set<V> get(K key)
           
 java.util.Set<K> keySet()
           
 boolean put(K key, V value)
           
 java.lang.String toString()
           
 java.util.Collection<V> values()
          Returns the all the values in the map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiMap

public MultiMap()
Method Detail

get

public java.util.Set<V> get(K key)

put

public boolean put(K key,
                   V value)

keySet

public java.util.Set<K> keySet()

containsKey

public boolean containsKey(K key)
Checks whether there is at least one value for the given key.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

values

public java.util.Collection<V> values()
Returns the all the values in the map. FIXME: The result is not backed by the map.