Class HashSetValuedHashMap<K,V>
- java.lang.Object
-
- org.apache.commons.collections4.multimap.AbstractMultiValuedMap<K,V>
-
- org.apache.commons.collections4.multimap.AbstractSetValuedMap<K,V>
-
- org.apache.commons.collections4.multimap.HashSetValuedHashMap<K,V>
-
- Type Parameters:
K
- the type of the keys in this mapV
- the type of the values in this map
- All Implemented Interfaces:
java.io.Serializable
,MultiValuedMap<K,V>
,SetValuedMap<K,V>
public class HashSetValuedHashMap<K,V> extends AbstractSetValuedMap<K,V> implements java.io.Serializable
Implements aSetValuedMap
, using aHashMap
to provide data storage andHashSet
s as value collections. This is the standard implementation of a SetValuedMap.Note that HashSetValuedHashMap is not synchronized and is not thread-safe. If you wish to use this map from multiple threads concurrently, you must use appropriate synchronization. This class may throw exceptions when accessed by concurrent threads without synchronization.
- Since:
- 4.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HashSetValuedHashMap()
Creates an empty HashSetValuedHashMap with the default initial map capacity (16) and the default initial set capacity (3).HashSetValuedHashMap(int initialSetCapacity)
Creates an empty HashSetValuedHashMap with the default initial map capacity (16) and the specified initial set capacity.HashSetValuedHashMap(int initialMapCapacity, int initialSetCapacity)
Creates an empty HashSetValuedHashMap with the specified initial map and list capacities.HashSetValuedHashMap(java.util.Map<? extends K,? extends V> map)
Creates an HashSetValuedHashMap copying all the mappings of the given map.HashSetValuedHashMap(MultiValuedMap<? extends K,? extends V> map)
Creates an HashSetValuedHashMap copying all the mappings of the given map.
-
Method Summary
-
Methods inherited from class org.apache.commons.collections4.multimap.AbstractSetValuedMap
get, remove
-
Methods inherited from class org.apache.commons.collections4.multimap.AbstractMultiValuedMap
asMap, clear, containsKey, containsMapping, containsValue, entries, equals, hashCode, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, size, toString, values
-
Methods inherited from interface org.apache.commons.collections4.MultiValuedMap
asMap, clear, containsKey, containsMapping, containsValue, entries, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, size, values
-
-
-
-
Constructor Detail
-
HashSetValuedHashMap
public HashSetValuedHashMap()
Creates an empty HashSetValuedHashMap with the default initial map capacity (16) and the default initial set capacity (3).
-
HashSetValuedHashMap
public HashSetValuedHashMap(int initialSetCapacity)
Creates an empty HashSetValuedHashMap with the default initial map capacity (16) and the specified initial set capacity.- Parameters:
initialSetCapacity
- the initial capacity used for value collections
-
HashSetValuedHashMap
public HashSetValuedHashMap(int initialMapCapacity, int initialSetCapacity)
Creates an empty HashSetValuedHashMap with the specified initial map and list capacities.- Parameters:
initialMapCapacity
- the initial hashmap capacityinitialSetCapacity
- the initial capacity used for value collections
-
HashSetValuedHashMap
public HashSetValuedHashMap(MultiValuedMap<? extends K,? extends V> map)
Creates an HashSetValuedHashMap copying all the mappings of the given map.- Parameters:
map
- aMultiValuedMap
to copy into this map
-
-