Package com.twelvemonkeys.util
Class WeakWeakMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.WeakHashMap<K,V>
com.twelvemonkeys.util.WeakWeakMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
Special-purpose map implementation with weak keys and weak values. This is
useful for mapping between keys and values that refer to (for example by
wrapping) their keys.
For more info, see
WeakHashMap
on why the
values in a WeakHashMap
must never refer strongly to their keys.- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/WeakWeakMap.java#1 $
- Author:
- Harald Kuhr
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionCreates aWeakWeakMap
with default initial capacity and load factor.WeakWeakMap
(int pInitialCapacity) Creates aWeakWeakMap
with the given initial capacity and default load factor.WeakWeakMap
(int pInitialCapacity, float pLoadFactor) Creates aWeakWeakMap
with the given initial capacity and load factor.WeakWeakMap
(Map<? extends K, ? extends V> pMap) Creates aWeakWeakMap
containing the mappings in the given map. -
Method Summary
Methods inherited from class java.util.WeakHashMap
clear, containsKey, forEach, isEmpty, keySet, replaceAll, size
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace
-
Constructor Details
-
WeakWeakMap
public WeakWeakMap()Creates aWeakWeakMap
with default initial capacity and load factor.- See Also:
-
WeakWeakMap
public WeakWeakMap(int pInitialCapacity) Creates aWeakWeakMap
with the given initial capacity and default load factor.- Parameters:
pInitialCapacity
- the initial capacity- See Also:
-
WeakWeakMap
public WeakWeakMap(int pInitialCapacity, float pLoadFactor) Creates aWeakWeakMap
with the given initial capacity and load factor.- Parameters:
pInitialCapacity
- the initial capacitypLoadFactor
- the load factor- See Also:
-
WeakWeakMap
Creates aWeakWeakMap
containing the mappings in the given map.- Parameters:
pMap
- the map whose mappings are to be placed in this map.- See Also:
-
-
Method Details
-
put
-
get
-
remove
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V> - Overrides:
containsValue
in classWeakHashMap<K,
V>
-
putAll
-
entrySet
-
values
-