Package org.drasyl.util
Class HashSetMultimap<K,V>
java.lang.Object
org.drasyl.util.HashSetMultimap<K,V>
- Type Parameters:
K
- the type of keys maintained by this mapV
- the type of mapped values
- All Implemented Interfaces:
Multimap<K,
,V> SetMultimap<K,
V>
Hash table based implementation of the
SetMultimap
interface.
This data structure is not thread-safe!
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
HashSetMultimap
public HashSetMultimap(int initialMapCapacity, int initialSetCapacity) -
HashSetMultimap
public HashSetMultimap()
-
-
Method Details
-
put
Description copied from interface:Multimap
Associates the specifiedvalue
with the specifiedkey
in this map. -
remove
Description copied from interface:Multimap
Removes the specifiedvalue
from the specifiedkey
. If no value left, the associatedkey
will be removed from the map. -
get
Description copied from interface:Multimap
Returns the values that are associated to the specifiedkey
. Returns a emptyCollection
if currently no values are assosicated to thekey
.- Specified by:
get
in interfaceMultimap<K,
V> - Specified by:
get
in interfaceSetMultimap<K,
V> - 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
.
-
keySet
Description copied from interface:Multimap
Returns aSet
with all the keys contained in this map.
-