|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.util.KeyValueList<K,V>
K
- key classV
- value classpublic class KeyValueList<K,V>
The KeyValueList
mapps multiple values to a single key.
Constructor Summary | |
---|---|
KeyValueList()
|
Method Summary | |
---|---|
void |
clear()
Clears the list so that it contains no keys. |
boolean |
contains(K pKey,
V pValue)
Tests whether this list maps a key which contains a specific value. |
boolean |
containsKey(K pKey)
Tests if the specified key is in this list. |
boolean |
containsValue(V pValue)
Tests if the specified values is in this list. |
Enumeration<List<V>> |
elements()
Returns an enumeration of the values in this list. |
Set<Map.Entry<K,List<V>>> |
entrySet()
Returns a Set view of the entries contained in this list. |
boolean |
equals(Object pObject)
|
List<V> |
get(K pKey)
Returns the value list for the specified key in the list. |
int |
hashCode()
|
boolean |
isEmpty()
Tests if the list is empty. |
Set<K> |
keySet()
Returns a Set view of the keys contained in this list. |
void |
put(K pKey,
V pValue)
Adds the specified pValue to a list of values which are
mapped to the pKey . |
void |
put(K pKey,
V pValue,
boolean pUnique)
Adds the specified pValue to a list of values which are
mapped to the pKey . |
void |
putAll(K pKey,
Collection<V> pValues)
Adds the specified pValue collection to a list of values which are
mapped to the pKey . |
List<V> |
remove(K pKey)
Removes the key (and its corresponding value) from this list. |
void |
remove(K pKey,
V pValue)
Removes a specific pValue from a list of values which is mapped to the
pKey . |
int |
size()
Returns the number of keys. |
String |
toString()
|
Collection<List<V>> |
values()
Returns a collection of the values in this list. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public KeyValueList()
Method Detail |
---|
public String toString()
toString
in class Object
public boolean equals(Object pObject)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void put(K pKey, V pValue)
pValue
to a list of values which are
mapped to the pKey
. Neither the pKey
nor the
pValue
can be null
.
pKey
- the keypValue
- the new value
NullPointerException
- if the key or value is null
public void putAll(K pKey, Collection<V> pValues)
pValue
collection to a list of values which are
mapped to the pKey
. Neither the pKey
nor the
pValue
can be null
.
pKey
- the keypValues
- the new value collection
NullPointerException
- if the key or value is null
public void put(K pKey, V pValue, boolean pUnique)
pValue
to a list of values which are
mapped to the pKey
. Neither the pKey
nor the
pValue
can be null
. It is possible to add the value
only if it is not already added.
pKey
- the keypValue
- the new valuepUnique
- true
to add the value only if it is not already in the list, false
to add
the value in any case
NullPointerException
- if the key or value is null
public List<V> get(K pKey)
pKey
- the key
null
if the key
is unknown
NullPointerException
- if the key is null
public void remove(K pKey, V pValue)
pValue
from a list of values which is mapped to the
pKey
.
pKey
- the keypValue
- the value to be removedpublic void clear()
public List<V> remove(K pKey)
pKey
- the key that needs to be removed.
null
if the key did not have a values.
NullPointerException
- if the key is null
.public boolean containsKey(K pKey)
pKey
- possible key.
true
if and only if the specified key
is in this list, false
otherwise.
NullPointerException
- if the key is null
.public boolean containsValue(V pValue)
pValue
- possible value.
true
if and only if the specified value
is in this list, false
otherwise.public boolean contains(K pKey, V pValue)
pKey
- the key.pValue
- the value.
true
when the value is mapped with the given key, otherwise false
.public int size()
public boolean isEmpty()
true
if the list is empty, false
otherwise.public Enumeration<List<V>> elements()
Enumeration
public Collection<List<V>> values()
Collection
public Set<K> keySet()
public Set<Map.Entry<K,List<V>>> entrySet()
Map.Entry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |