se.lth.cs.nlp.nlputils.core
Class ListHash<K,V>

java.lang.Object
  extended by se.lth.cs.nlp.nlputils.core.ListHash<K,V>

public class ListHash<K,V>
extends Object

A map from a key type to a list of the value type.

Author:
Richard Johansson (richard@cs.lth.se)

Constructor Summary
ListHash()
           
 
Method Summary
 boolean containsKey(K key)
          Checks whether the map contains a given key.
 ArrayList<V> get(K key)
          Returns the association list for key.
 void put(K key, V value)
          Adds value to the association list of key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListHash

public ListHash()
Method Detail

put

public void put(K key,
                V value)
Adds value to the association list of key.

Parameters:
key - the key.
value - the value.

get

public ArrayList<V> get(K key)
Returns the association list for key.

Parameters:
key - the key.
Returns:
the list.

containsKey

public boolean containsKey(K key)
Checks whether the map contains a given key.

Parameters:
key - the key.