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>
public class WeakWeakMap<K,V>
- extends 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, 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:
WeakHashMap,
WeakReference
|
Constructor Summary |
WeakWeakMap()
Creates a WeakWeakMap with default initial capacity and load
factor. |
WeakWeakMap(int pInitialCapacity)
Creates a WeakWeakMap with the given initial capacity and
default load factor. |
WeakWeakMap(int pInitialCapacity,
float pLoadFactor)
Creates a WeakWeakMap with the given initial capacity and
load factor. |
WeakWeakMap(Map<? extends K,? extends V> pMap)
Creates a WeakWeakMap containing the mappings in the given map. |
WeakWeakMap
public WeakWeakMap()
- Creates a
WeakWeakMap with default initial capacity and load
factor.
- See Also:
WeakHashMap.WeakHashMap()
WeakWeakMap
public WeakWeakMap(int pInitialCapacity)
- Creates a
WeakWeakMap with the given initial capacity and
default load factor.
- Parameters:
pInitialCapacity - the initial capacity- See Also:
WeakHashMap.WeakHashMap(int)
WeakWeakMap
public WeakWeakMap(int pInitialCapacity,
float pLoadFactor)
- Creates a
WeakWeakMap with the given initial capacity and
load factor.
- Parameters:
pInitialCapacity - the initial capacitypLoadFactor - the load factor- See Also:
WeakHashMap.WeakHashMap(int, float)
WeakWeakMap
public WeakWeakMap(Map<? extends K,? extends V> pMap)
- Creates a
WeakWeakMap containing the mappings in the given map.
- Parameters:
pMap - the map whose mappings are to be placed in this map.- See Also:
WeakHashMap.WeakHashMap(java.util.Map)
put
public V put(K pKey,
V pValue)
- Specified by:
put in interface Map<K,V>- Overrides:
put in class WeakHashMap<K,V>
get
public V get(Object pKey)
- Specified by:
get in interface Map<K,V>- Overrides:
get in class WeakHashMap<K,V>
remove
public V remove(Object pKey)
- Specified by:
remove in interface Map<K,V>- Overrides:
remove in class WeakHashMap<K,V>
containsValue
public boolean containsValue(Object pValue)
- Specified by:
containsValue in interface Map<K,V>- Overrides:
containsValue in class WeakHashMap<K,V>
putAll
public void putAll(Map<? extends K,? extends V> pMap)
- Specified by:
putAll in interface Map<K,V>- Overrides:
putAll in class WeakHashMap<K,V>
entrySet
public Set<Map.Entry<K,V>> entrySet()
- Specified by:
entrySet in interface Map<K,V>- Overrides:
entrySet in class WeakHashMap<K,V>
values
public Collection<V> values()
- Specified by:
values in interface Map<K,V>- Overrides:
values in class WeakHashMap<K,V>
Copyright © 2014. All Rights Reserved.