Contents
Class WeakValueHashMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.infinispan.commons.util.WeakValueHashMap<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
Map<K,V>
This Map will remove entries when the value in the map has been cleaned from
garbage collection
- Author:
- Bill Burke, Adrian Brock, Ales Justin
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, emptyWeakValueHashMapwith the default initial capacity and the default load factor, which is0.75.WeakValueHashMap(int initialCapacity) Constructs a new, emptyWeakValueHashMapwith the given initial capacity and the default load factor, which is0.75.WeakValueHashMap(int initialCapacity, float loadFactor) Constructs a new, emptyWeakValueHashMapwith the given initial capacity and the given load factor.WeakValueHashMap(Map<K, V> t) Constructs a newWeakValueHashMapwith the same mappings as the specifiedMap. -
Method Summary
Methods inherited from class AbstractMap
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, valuesMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
WeakValueHashMap
public WeakValueHashMap(int initialCapacity, float loadFactor) Constructs a new, emptyWeakValueHashMapwith the given initial capacity and the given load factor.- Parameters:
initialCapacity- The initial capacity of theWeakValueHashMaploadFactor- The load factor of theWeakValueHashMap- Throws:
IllegalArgumentException- If the initial capacity is less than zero, or if the load factor is nonpositive
-
WeakValueHashMap
public WeakValueHashMap(int initialCapacity) Constructs a new, emptyWeakValueHashMapwith the given initial capacity and the default load factor, which is0.75.- Parameters:
initialCapacity- The initial capacity of theWeakValueHashMap- Throws:
IllegalArgumentException- If the initial capacity is less than zero
-
WeakValueHashMap
public WeakValueHashMap()Constructs a new, emptyWeakValueHashMapwith the default initial capacity and the default load factor, which is0.75. -
WeakValueHashMap
Constructs a newWeakValueHashMapwith the same mappings as the specifiedMap. TheWeakValueHashMapis 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 is0.75.- Parameters:
t- the map whose mappings are to be placed in this map.- Since:
- 1.3
-
-
Method Details
-
createMap
-
size
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
get
-
put
-
remove
-
entrySet
-
clear
-
toString
- Overrides:
toStringin classAbstractMap<K,V>
-