K
- the key typeV
- the value typepublic class WeakValueHashMap<K,V> extends ReferenceValueHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
WeakValueHashMap()
Constructs a new, empty
WeakValueHashMap with the default
initial capacity and the default load factor, which is
0.75 . |
WeakValueHashMap(int initialCapacity)
Constructs a new, empty
WeakValueHashMap with the given
initial capacity and the default load factor, which is
0.75 . |
WeakValueHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty
WeakValueHashMap with the given
initial capacity and the given load factor. |
WeakValueHashMap(Map<K,V> t)
Constructs a new
WeakValueHashMap with the same mappings as the
specified Map. |
Modifier and Type | Method and Description |
---|---|
protected ValueRef<K,V> |
create(K key,
V value,
ReferenceQueue<V> q)
Create new value ref instance.
|
createMap, createMap, createMap, createMap, createMap
clear, containsKey, entrySet, get, put, remove, size, toString
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public WeakValueHashMap(int initialCapacity, float loadFactor)
WeakValueHashMap
with the given
initial capacity and the given load factor.initialCapacity
- The initial capacity of the
WeakValueHashMap
loadFactor
- The load factor of the WeakValueHashMap
IllegalArgumentException
- If the initial capacity is less than
zero, or if the load factor is
nonpositivepublic WeakValueHashMap(int initialCapacity)
WeakValueHashMap
with the given
initial capacity and the default load factor, which is
0.75
.initialCapacity
- The initial capacity of the
WeakValueHashMap
IllegalArgumentException
- If the initial capacity is less than
zeropublic WeakValueHashMap()
WeakValueHashMap
with the default
initial capacity and the default load factor, which is
0.75
.public WeakValueHashMap(Map<K,V> t)
WeakValueHashMap
with the same mappings as the
specified Map. The WeakValueHashMap
is created with an
initial capacity of twice the number of mappings in the specified map
or 11 (whichever is greater), and a default load factor, which is
0.75.t
- the map whose mappings are to be placed in this map.protected ValueRef<K,V> create(K key, V value, ReferenceQueue<V> q)
ReferenceValueMap
create
in class ReferenceValueMap<K,V>
key
- the keyvalue
- the valueq
- the ref queueCopyright © 2018 JBoss by Red Hat. All rights reserved.