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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all entries from this multimap.Returns the values that are associated to the specifiedkey.booleanisEmpty()Returnstrueif this multimap contains no entries.keySet()Returns aSetwith all the keys contained in this map.booleanAssociates the specifiedvaluewith the specifiedkeyin this map.booleanputAll(K key, Collection<? extends V> values) Associates the specifiedvalueswith the specifiedkeyin this map.final booleanAssociates the specifiedvalueswith the specifiedkeyin this map.booleanRemoves the specifiedvaluefrom the specifiedkey.
-
Constructor Details
-
HashSetMultimap
public HashSetMultimap(int initialMapCapacity, int initialSetCapacity) -
HashSetMultimap
public HashSetMultimap()
-
-
Method Details
-
put
Description copied from interface:MultimapAssociates the specifiedvaluewith the specifiedkeyin this map. -
putAll
Description copied from interface:MultimapAssociates the specifiedvalueswith the specifiedkeyin this map. -
putAll
Description copied from interface:MultimapAssociates the specifiedvalueswith the specifiedkeyin this map. -
remove
Description copied from interface:MultimapRemoves the specifiedvaluefrom the specifiedkey. If no value left, the associatedkeywill be removed from the map. -
get
Description copied from interface:MultimapReturns the values that are associated to the specifiedkey. Returns a emptyCollectionif currently no values are assosicated to thekey.- Specified by:
getin interfaceMultimap<K,V> - Specified by:
getin 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 emptyCollectionif currently no values are assosicated to thekey.
-
keySet
Description copied from interface:MultimapReturns aSetwith all the keys contained in this map. -
isEmpty
public boolean isEmpty()Description copied from interface:MultimapReturnstrueif this multimap contains no entries. -
clear
public void clear()Description copied from interface:MultimapRemoves all entries from this multimap.
-