public class SoftValueHashMap<K,V> extends ReferenceValueHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
SoftValueHashMap()
Constructs a new, empty
SoftValueHashMap with the default
initial capacity and the default load factor, which is
0.75 . |
SoftValueHashMap(int initialCapacity)
Constructs a new, empty
SoftValueHashMap with the given
initial capacity and the default load factor, which is
0.75 . |
SoftValueHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty
SoftValueHashMap with the given
initial capacity and the given load factor. |
SoftValueHashMap(Map<K,V> t)
Constructs a new
SoftValueHashMap 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 SoftValueHashMap(int initialCapacity, float loadFactor)
SoftValueHashMap
with the given
initial capacity and the given load factor.initialCapacity
- The initial capacity of the
SoftValueHashMap
loadFactor
- The load factor of the SoftValueHashMap
IllegalArgumentException
- If the initial capacity is less than
zero, or if the load factor is
nonpositivepublic SoftValueHashMap(int initialCapacity)
SoftValueHashMap
with the given
initial capacity and the default load factor, which is
0.75
.initialCapacity
- The initial capacity of the
SoftValueHashMap
IllegalArgumentException
- If the initial capacity is less than
zeropublic SoftValueHashMap()
SoftValueHashMap
with the default
initial capacity and the default load factor, which is
0.75
.public SoftValueHashMap(Map<K,V> t)
SoftValueHashMap
with the same mappings as the
specified Map. The SoftValueHashMap
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.