|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MultiMap
A map where keys are mapped to non-empty Set objects. Has the same
behavior as the standard Map interface, except that the value passed to
put
must be a Set; get
returns an empty set
instead of null
when the given key is not in the map; and
there are new add
and remove
methods.
Nested Class Summary | |
---|---|
static class |
MultiMap.EmptyMultiMap
|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
static MultiMap |
EMPTY_MULTI_MAP
An unmodifiable multi-map that maps all keys to the empty set. |
Method Summary | |
---|---|
boolean |
add(java.lang.Object key,
java.lang.Object value)
Adds the given value to the set associated with the given key. |
boolean |
addAll(java.lang.Object key,
java.util.Set values)
Adds all elements of the given set to the set associated with the given key. |
java.lang.Object |
get(java.lang.Object key)
Returns the set associated with the given key. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the given key with the given value, which must be a Set. |
boolean |
remove(java.lang.Object key,
java.lang.Object value)
Removes the given value from the set associated with the given key. |
boolean |
removeAll(java.lang.Object key,
java.util.Set values)
Removes all elements of the given set from the set associated with the given key. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values |
Field Detail |
---|
static final MultiMap EMPTY_MULTI_MAP
Method Detail |
---|
java.lang.Object get(java.lang.Object key)
put
method is called or if all the values for the
given key are removed.
get
in interface java.util.Map
java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
java.lang.IllegalArgumentException
- if value
is not a Setboolean add(java.lang.Object key, java.lang.Object value)
boolean addAll(java.lang.Object key, java.util.Set values)
boolean remove(java.lang.Object key, java.lang.Object value)
boolean removeAll(java.lang.Object key, java.util.Set values)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |