public class MultiMap<K,V>
extends java.util.AbstractMap<K,java.util.Set<V>>
MultiMap
is a map that allows the same key to be used to map
to multiple values.
It is therefore an arbitrary binary relation on keys and values.Constructor and Description |
---|
MultiMap() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(K key,
V value)
Adds a single value into the set associated with
key . |
boolean |
addAll(K key,
java.util.Collection<V> values)
Adds all the values in
values into the set associated with
key . |
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,java.util.Set<V>>> |
entrySet() |
java.util.Set<V> |
get(java.lang.Object key) |
java.util.Set<V> |
getValues(java.lang.Object key)
The set of values associated with a key.
|
java.util.Set<V> |
put(K key,
java.util.Set<V> value)
Makes
key map to value , where value
has to be a collection of objects. |
java.util.Set<V> |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
java.lang.String |
toString() |
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.util.Set<V> get(java.lang.Object key)
public java.util.Set<V> getValues(java.lang.Object key)
public java.util.Set<V> put(K key, java.util.Set<V> value)
key
map to value
, where value
has to be a collection of objects.public boolean addAll(K key, java.util.Collection<V> values)
values
into the set associated with
key
.public java.util.Set<V> remove(java.lang.Object key)
public boolean remove(java.lang.Object key, java.lang.Object value)
public void clear()