Package pascal.taie.util.collection
Class MapSetMultiMap<K,V>
java.lang.Object
pascal.taie.util.collection.AbstractMultiMap<K,V>
pascal.taie.util.collection.MapSetMultiMap<K,V>
- Type Parameters:
K
- type of the keys in this mapV
- type of the values in this map
- All Implemented Interfaces:
Serializable
,MultiMap<K,
V>
An implementation of
MultiMap
that stores key-value pairs
as a map from key to the sets of its corresponding values.- See Also:
-
Field Summary
Fields inherited from class pascal.taie.util.collection.AbstractMultiMap
NULL_KEY, NULL_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all key-value pairs from the multimap, leaving it empty.boolean
boolean
containsKey
(K key) void
forEachSet
(BiConsumer<K, Set<V>> action) Performs the given action for key-(value-set) pairs contained in this multimap.int
hashCode()
keySet()
boolean
Stores a key-value pair in this multimap.boolean
putAll
(K key, Collection<? extends V> values) Stores a key-value pair in this multimap for each ofvalues
, all using the same key,key
.=boolean
Stores all key-value pairs ofmultimap
in this multimap.boolean
Removes a single key-value pair with the keykey
and the valuevalue
from this multimap, if such exists.boolean
Removes all values associated with the keykey
.boolean
removeAll
(K key, Collection<? extends V> values) Removes all key-value pairs forkey
andvalues
.int
size()
Methods inherited from class pascal.taie.util.collection.AbstractMultiMap
containsValue, entrySet, equals, isEmpty, toString, values
-
Constructor Details
-
MapSetMultiMap
-
-
Method Details
-
contains
-
containsKey
- Specified by:
containsKey
in interfaceMultiMap<K,
V> - Returns:
true
if this multimap contains at least one key-value pair with the keykey
.
-
get
-
put
Description copied from interface:MultiMap
Stores a key-value pair in this multimap. -
putAll
Description copied from interface:MultiMap
Stores a key-value pair in this multimap for each ofvalues
, all using the same key,key
.= -
putAll
Description copied from interface:MultiMap
Stores all key-value pairs ofmultimap
in this multimap. -
remove
Description copied from interface:MultiMap
Removes a single key-value pair with the keykey
and the valuevalue
from this multimap, if such exists. -
removeAll
Description copied from interface:MultiMap
Removes all values associated with the keykey
.Once this method returns,
key
will not be mapped to any values, so it will not appear inMultiMap.keySet()
. -
removeAll
Description copied from interface:MultiMap
Removes all key-value pairs forkey
andvalues
. -
keySet
-
entryIterator
- Specified by:
entryIterator
in classAbstractMultiMap<K,
V>
-
forEachSet
Description copied from interface:MultiMap
Performs the given action for key-(value-set) pairs contained in this multimap.- Specified by:
forEachSet
in interfaceMultiMap<K,
V>
-
clear
public void clear()Description copied from interface:MultiMap
Removes all key-value pairs from the multimap, leaving it empty. -
size
public int size() -
hashCode
public int hashCode()
-