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:
java.util.Map<K,V>
public class WeakWeakMap<K,V> extends java.util.WeakHashMap<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, seeWeakHashMap
on why the values in aWeakHashMap
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:
WeakHashMap
,WeakReference
-
-
Constructor Summary
Constructors Constructor Description WeakWeakMap()
Creates 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(java.util.Map<? extends K,? extends V> pMap)
Creates aWeakWeakMap
containing the mappings in the given map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsValue(java.lang.Object pValue)
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
V
get(java.lang.Object pKey)
V
put(K pKey, V pValue)
void
putAll(java.util.Map<? extends K,? extends V> pMap)
V
remove(java.lang.Object pKey)
java.util.Collection<V>
values()
-
Methods inherited from class java.util.WeakHashMap
clear, containsKey, forEach, isEmpty, keySet, replaceAll, size
-
-
-
-
Constructor Detail
-
WeakWeakMap
public WeakWeakMap()
Creates aWeakWeakMap
with default initial capacity and load factor.- See Also:
WeakHashMap()
-
WeakWeakMap
public WeakWeakMap(int pInitialCapacity)
Creates aWeakWeakMap
with the given initial capacity and default load factor.- Parameters:
pInitialCapacity
- the initial capacity- See Also:
WeakHashMap(int)
-
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:
WeakHashMap(int, float)
-
-
Method Detail
-
get
public V get(java.lang.Object pKey)
-
remove
public V remove(java.lang.Object pKey)
-
containsValue
public boolean containsValue(java.lang.Object pValue)
-
-