Package org.drasyl.util
Interface Multimap<K,V>
- Type Parameters:
K
- the type of keys maintained by this mapV
- the type of mapped values
- All Known Subinterfaces:
SetMultimap<K,
V>
- All Known Implementing Classes:
HashSetMultimap
public interface Multimap<K,V>
A map in which more than one value may be associated with and returned for a given key
-
Method Summary
-
Method Details
-
put
Associates the specifiedvalue
with the specifiedkey
in this map.- Parameters:
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key- Returns:
true
if the specifiedvalue
could be associated with the specifiedkey
- Throws:
NullPointerException
- ifkey
isnull
-
remove
Removes the specifiedvalue
from the specifiedkey
. If no value left, the associatedkey
will be removed from the map.- Parameters:
key
- key with which the specified value is associatedvalue
- value expected to be associated with the specified key- Returns:
true
if the specifiedvalue
could be removed from the specifiedkey
- Throws:
NullPointerException
- ifkey
isnull
-
get
Returns the values that are associated to the specifiedkey
. Returns a emptyCollection
if currently no values are assosicated to thekey
.- Parameters:
key
- the key whose associated values should be returned- Returns:
- the values that are associated to the specified
key
. Returns a emptyCollection
if currently no values are assosicated to thekey
. - Throws:
NullPointerException
- ifkey
isnull
-
keySet
Returns aSet
with all the keys contained in this map.- Returns:
Set
with all the keys contained in this map
-