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, seeWeakHashMapon why the values in aWeakHashMapmust 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:
WeakHashMap,WeakReference
-
-
Constructor Summary
Constructors Constructor Description WeakWeakMap()Creates 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(java.util.Map<? extends K,? extends V> pMap)Creates aWeakWeakMapcontaining the mappings in the given map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsValue(java.lang.Object pValue)java.util.Set<java.util.Map.Entry<K,V>>entrySet()Vget(java.lang.Object pKey)Vput(K pKey, V pValue)voidputAll(java.util.Map<? extends K,? extends V> pMap)Vremove(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 aWeakWeakMapwith default initial capacity and load factor.- See Also:
WeakHashMap()
-
WeakWeakMap
public WeakWeakMap(int pInitialCapacity)
Creates aWeakWeakMapwith 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 aWeakWeakMapwith 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)
-
-