|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsdsi.util.MultiMap
A one-to-many map: each key is associated with a set of values. Note that get(key) returns the empty set if no value has previously been put() for that key.
Constructor Summary | |
MultiMap()
|
Method Summary | |
java.util.Set |
get(java.lang.Object key)
Returns the Set for a given key. |
boolean |
isEmpty()
Returns true if this MultiMap contains no elements. |
void |
put(java.lang.Object key,
java.lang.Object value)
Adds a Set for a given key to this MultiMap . |
void |
putAll(java.lang.Object key,
java.util.Collection coll)
Adds the elements of a given collection to the set for a given key in this MultiMap . |
void |
remove(java.lang.Object key,
java.lang.Object value)
Remove an object from the set added with the key key . |
int |
size()
Returns the number of elements in this MultiMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MultiMap()
Method Detail |
public java.util.Set get(java.lang.Object key)
Set
for a given key. If the key hasn't been
previously inserted with the put-method an empty set is returned.
key
- key so return the set for.
key
previously.put(Object, Object)
public void put(java.lang.Object key, java.lang.Object value)
Set
for a given key to this MultiMap
.
key
- key to add the set for.value
- set to add with key key
.public void putAll(java.lang.Object key, java.util.Collection coll)
MultiMap
.
key
- key to add the collections for.coll
- collection to add for key
.public void remove(java.lang.Object key, java.lang.Object value)
key
.
key
- key of set to remove value
from.value
- value to remove from the set that has been put with key
key
.public int size()
public boolean isEmpty()
true
if this MultiMap contains no elements.
true
if this MultiMap contains no elements.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |