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
Modifier and TypeMethodDescriptionvoid
clear()
Removes all entries from this multimap.Returns the values that are associated to the specifiedkey
.boolean
isEmpty()
Returnstrue
if this multimap contains no entries.keySet()
Returns aSet
with all the keys contained in this map.boolean
Associates the specifiedvalue
with the specifiedkey
in this map.boolean
putAll
(K key, Collection<? extends V> values) Associates the specifiedvalues
with the specifiedkey
in this map.final boolean
Associates the specifiedvalues
with the specifiedkey
in this map.boolean
Removes the specifiedvalue
from the specifiedkey
.
-
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. -
putAll
Description copied from interface:Multimap
Associates the specifiedvalues
with the specifiedkey
in this map. -
putAll
Description copied from interface:Multimap
Associates the specifiedvalues
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. -
isEmpty
public boolean isEmpty()Description copied from interface:Multimap
Returnstrue
if this multimap contains no entries. -
clear
public void clear()Description copied from interface:Multimap
Removes all entries from this multimap.
-