public class HashSetValuedHashMap<K,V> extends AbstractSetValuedMap<K,V> implements Serializable
SetValuedMap, using a HashMap to provide data
storage and HashSets 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.
| Constructor and 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(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.
|
| Modifier and Type | Method and Description |
|---|---|
protected HashSet<V> |
createCollection()
Creates a new value collection using the provided factory.
|
get, getMap, removeasMap, clear, containsKey, containsMapping, containsValue, doReadObject, doWriteObject, entries, equals, hashCode, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, setMap, size, toString, valuesclone, finalize, getClass, notify, notifyAll, wait, wait, waitasMap, clear, containsKey, containsMapping, containsValue, entries, isEmpty, keys, keySet, mapIterator, put, putAll, putAll, putAll, removeMapping, size, valuespublic HashSetValuedHashMap()
public HashSetValuedHashMap(int initialSetCapacity)
initialSetCapacity - the initial capacity used for value collectionspublic HashSetValuedHashMap(int initialMapCapacity,
int initialSetCapacity)
initialMapCapacity - the initial hashmap capacityinitialSetCapacity - the initial capacity used for value collectionspublic HashSetValuedHashMap(MultiValuedMap<? extends K,? extends V> map)
map - a MultiValuedMap to copy into this mapprotected HashSet<V> createCollection()
AbstractSetValuedMapcreateCollection in class AbstractSetValuedMap<K,V>Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.