public class ArrayListValuedHashMap<K,V> extends AbstractListValuedMap<K ,V> implements Serializable
ListValuedMap, using a
HashMap to provide data storage and
ArrayLists as value collections. This is the standard implementation of a ListValuedMap.
Note that ArrayListValuedHashMap 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 |
|---|
ArrayListValuedHashMap()
Creates an empty ArrayListValuedHashMap with the default initial map capacity (16) and the default initial list capacity (3).
|
ArrayListValuedHashMap(int initialListCapacity)
Creates an empty ArrayListValuedHashMap with the default initial map capacity (16) and the specified initial list capacity.
|
ArrayListValuedHashMap(int initialMapCapacity, int initialListCapacity)
Creates an empty ArrayListValuedHashMap with the specified initial map and list capacities.
|
ArrayListValuedHashMap(Map
Creates an ArrayListValuedHashMap copying all the mappings of the given map.
|
ArrayListValuedHashMap(MultiValuedMap
Creates an ArrayListValuedHashMap copying all the mappings of the given map.
|
| Modifier and Type | Method and Description |
|---|---|
protected ArrayList |
createCollection()
Creates a new value collection using the provided factory.
|
void |
trimToSize()
Trims the capacity of all value collections to their current size.
|
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 ArrayListValuedHashMap()
public ArrayListValuedHashMap(int initialListCapacity)
initialListCapacity - the initial capacity used for value collections
public ArrayListValuedHashMap(int initialMapCapacity,
int initialListCapacity)
initialMapCapacity - the initial hashmap capacity
initialListCapacity - the initial capacity used for value collections
public ArrayListValuedHashMap(MultiValuedMap<? extends K ,? extends V> map)
map - a
MultiValuedMap to copy into this map
protected ArrayList<V> createCollection()
AbstractListValuedMap
createCollection in class
AbstractListValuedMap<K,V>
public void trimToSize()