public class WeakValuedHashMap<K,V> extends ReferencedValueHashMap<K,V>
Note: Weakly referenced entries may be automatically removed during either accessor or mutator operations, possibly causing a concurrent modification to be detected. Therefore, even if multiple threads are only accessing this map, be sure to synchronize this map first. Also, do not rely on the value returned by size() when using an iterator from this map. The iterators may return less entries than the amount reported by size().
WeakValueCache
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
WeakValuedHashMap()
Constructs a new, empty map with a default capacity and load
factor, which is 0.75.
|
WeakValuedHashMap(int initialCapacity)
Constructs a new, empty map with the specified initial capacity
and default load factor, which is 0.75.
|
WeakValuedHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty map with the specified initial
capacity and the specified load factor.
|
WeakValuedHashMap(Map<? extends K,? extends V> t)
Constructs a new map with the same mappings as the given map.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, toString, values
equals, hashCode
public WeakValuedHashMap(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of the HashMap.loadFactor
- the load factor of the HashMapIllegalArgumentException
- if the initial capacity is less
than zero, or if the load factor is nonpositive.public WeakValuedHashMap(int initialCapacity)
initialCapacity
- the initial capacity of the HashMap.IllegalArgumentException
- if the initial capacity is less
than zero.public WeakValuedHashMap()
Copyright © 2004-2015 Cojen. All Rights Reserved.