com.sibvisions.util
Class KeyValueList<K,V>

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<K,List<V>>
          extended by com.sibvisions.util.KeyValueList<K,V>
Type Parameters:
K - key class
V - value class
All Implemented Interfaces:
Serializable, Cloneable, Map<K,List<V>>

public class KeyValueList<K,V>
extends Hashtable<K,List<V>>

The KeyValueList is a special Hashtable. It mapps multiple values to a single key.

See Also:
Serialized Form

Constructor Summary
KeyValueList()
           
 
Method Summary
 boolean contains(Object pValue)
          
 void put(K pKey, V pValue)
          Adds the specified pValue to a list of values which are mapped to the pKey.
 void remove(K pKey, V pValue)
          Removes a specific pValue from a list of values which is mapped to the pKey.
 
Methods inherited from class java.util.Hashtable
clear, clone, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyValueList

public KeyValueList()
Method Detail

contains

public boolean contains(Object pValue)

Overrides:
contains in class Hashtable<K,List<V>>

put

public void put(K pKey,
                V pValue)
Adds the specified pValue to a list of values which are mapped to the pKey. Neither the pKey nor the pValue can be null.

Parameters:
pKey - the key
pValue - the new value
Throws:
NullPointerException - if the key or value is null

remove

public void remove(K pKey,
                   V pValue)
Removes a specific pValue from a list of values which is mapped to the pKey.

Parameters:
pKey - the key
pValue - the value to be removed


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.