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 $
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionCreates aWeakWeakMapwith default initial capacity and load factor.WeakWeakMap(int pInitialCapacity) Creates aWeakWeakMapwith the given initial capacity and default load factor.WeakWeakMap(int pInitialCapacity, float pLoadFactor) Creates aWeakWeakMapwith the given initial capacity and load factor.WeakWeakMap(Map<? extends K, ? extends V> pMap) Creates aWeakWeakMapcontaining the mappings in the given map. -
Method Summary
Methods inherited from class java.util.WeakHashMap
clear, containsKey, forEach, isEmpty, keySet, newWeakHashMap, replaceAll, sizeMethods inherited from class java.util.AbstractMap
clone, equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace
-
Constructor Details
-
WeakWeakMap
public WeakWeakMap()Creates aWeakWeakMapwith default initial capacity and load factor.- See Also:
-
WeakWeakMap
public WeakWeakMap(int pInitialCapacity) Creates aWeakWeakMapwith the given initial capacity and default load factor.- Parameters:
pInitialCapacity- the initial capacity- See Also:
-
WeakWeakMap
public WeakWeakMap(int pInitialCapacity, float pLoadFactor) Creates aWeakWeakMapwith the given initial capacity and load factor.- Parameters:
pInitialCapacity- the initial capacitypLoadFactor- the load factor- See Also:
-
WeakWeakMap
Creates aWeakWeakMapcontaining 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:
containsValuein interfaceMap<K,V> - Overrides:
containsValuein classWeakHashMap<K,V>
-
putAll
-
entrySet
-
values
-