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 specifiedvaluewith the specifiedkeyin this map.- Parameters:
key- key with which the specified value is to be associatedvalue- value to be associated with the specified key- Returns:
trueif the specifiedvaluecould be associated with the specifiedkey- Throws:
NullPointerException- ifkeyisnull
-
remove
Removes the specifiedvaluefrom the specifiedkey. If no value left, the associatedkeywill 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:
trueif the specifiedvaluecould be removed from the specifiedkey- Throws:
NullPointerException- ifkeyisnull
-
get
Returns the values that are associated to the specifiedkey. Returns a emptyCollectionif 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 emptyCollectionif currently no values are assosicated to thekey. - Throws:
NullPointerException- ifkeyisnull
-
keySet
Returns aSetwith all the keys contained in this map.- Returns:
Setwith all the keys contained in this map
-