Class MultiMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,List<V>>
org.apache.wicket.util.collections.MultiMap<K,V>
- Type Parameters:
K
-V
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<K,
List<V>>
A simple multimap
- Author:
- igor
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds value to the specified keygetFirstValue
(K key) Gets the first value in the value listvoid
removeValue
(K key, V value) Removes value from the specified keyvoid
replaceValues
(K key, V value) Replaces all existing values with the specified value.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
MultiMap
public MultiMap()Constructor- See Also:
-
MultiMap
Constructor- Parameters:
initialCapacity
-loadFactor
-- See Also:
-
MultiMap
Constructor- Parameters:
initialCapacity
-- See Also:
-
MultiMap
Constructor- Parameters:
m
-- See Also:
-
-
Method Details
-
addValue
Adds value to the specified key- Parameters:
key
-value
-
-
removeValue
Removes value from the specified key- Parameters:
key
-value
-
-
replaceValues
Replaces all existing values with the specified value. If no values exist for the key the value will be added.- Parameters:
key
-value
-
-
getFirstValue
Gets the first value in the value list- Parameters:
key
-- Returns:
- first value
-