public abstract class Multimap<Key,Value>
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<Key,java.util.Collection<Value>> |
asMap()
Get the underlying map.
|
void |
clear()
Clear the multimap.
|
boolean |
containsValue(Value value)
Check if the multimap contains a value.
|
java.util.Set<java.util.Map.Entry<Key,Value>> |
entries()
Get all key-value pairs in the multimap.
|
java.util.Collection<Value> |
get(Key key)
Get all values for a key.
|
boolean |
isEmpty()
Check if the multimap is empty.
|
java.util.Set<Key> |
keySet()
Get all keys in the multimap.
|
abstract void |
put(Key key,
Value value)
Put a key-value pair into the multimap.
|
void |
putAll(Key key,
java.util.Collection<Value> values)
Put all values for a key into the multimap.
|
void |
putAll(java.util.Map<Key,Value> map)
Put all key-value pairs from a map into the multimap.
|
void |
putAll(Multimap<Key,Value> multimap)
Put all key-value pairs from a multimap into the multimap.
|
int |
size()
Get the number of key-value pairs in the multimap.
|
public abstract void put(Key key, Value value)
key - the keyvalue - the valuepublic java.util.Collection<Value> get(Key key)
key - the keypublic void putAll(java.util.Map<Key,Value> map)
map - the mappublic void putAll(Multimap<Key,Value> multimap)
multimap - the multimappublic void putAll(Key key, java.util.Collection<Value> values)
key - the keyvalues - the valuespublic java.util.Set<java.util.Map.Entry<Key,Value>> entries()
public java.util.Map<Key,java.util.Collection<Value>> asMap()
public java.util.Set<Key> keySet()
public boolean containsValue(Value value)
value - the valuepublic int size()
public boolean isEmpty()
public void clear()