org.graffiti.util
Class MutualWeakHashMap<K extends MutuallyReferable,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.WeakHashMap<K,WeakReference<V>>
          extended by org.graffiti.util.MutualWeakHashMap<K,V>
All Implemented Interfaces:
Map<K,WeakReference<V>>

public class MutualWeakHashMap<K extends MutuallyReferable,V>
extends WeakHashMap<K,WeakReference<V>>

A hashtable-based Map implementation with both weak keys and values. This map extends WeakHashMap and additional wraps the values in WeakReferences.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner
See Also:
WeakHashSet

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
MutualWeakHashMap()
           
 
Method Summary
 V get(K key)
          Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
 void put(K key, V value)
          Associates the specified value with the specified key in this map.
 
Methods inherited from class java.util.WeakHashMap
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

MutualWeakHashMap

public MutualWeakHashMap()
Method Detail

put

public void put(K key,
                V value)
Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.


get

public V get(K key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Returns:
the value to which the specified key is mapped, or null if this map contains no mapping for the key.


Generated at 2012-05-30 11:00:14 PM CEST