|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.IdentityKeyValueList<K,V>
K - key classV - value classpublic class IdentityKeyValueList<K,V>
The KeyValueList is a special IdentityHashMap. It
mapps multiple values to a single key.
| Constructor Summary | |
|---|---|
IdentityKeyValueList()
|
|
| 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. |
java.util.Set<java.util.Map.Entry<K,java.util.List<V>>> |
entrySet()
Returns a Set view of the entries contained in this list. |
boolean |
equals(java.lang.Object pObject)
|
java.util.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. |
java.util.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,
java.util.Collection<V> pValues)
Adds the specified pValue collection to a list of values which are
mapped to the pKey. |
java.util.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. |
java.lang.String |
toString()
|
java.util.Collection<java.util.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 IdentityKeyValueList()
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object pObject)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.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
java.lang.NullPointerException - if the key or value is null
public void putAll(K pKey,
java.util.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
java.lang.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
java.lang.NullPointerException - if the key or value is nullpublic java.util.List<V> get(K pKey)
pKey - the key
null if the key
is unknown
java.lang.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 java.util.List<V> remove(K pKey)
pKey - the key that needs to be removed.
null if the key did not have a values.
java.lang.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.
java.lang.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 java.util.Collection<java.util.List<V>> values()
Collectionpublic java.util.Set<K> keySet()
public java.util.Set<java.util.Map.Entry<K,java.util.List<V>>> entrySet()
Map.Entry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||