edu.toronto.cs.util
Class SoftSoftHashMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by edu.toronto.cs.util.SoftHashMap
              extended by edu.toronto.cs.util.SoftSoftHashMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class SoftSoftHashMap
extends SoftHashMap

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
SoftSoftHashMap()
           
 
Method Summary
 java.lang.Object get(java.lang.Object key)
          Gets the value the key is mapped to.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Here we put the key, value pair into the HashMap using a WeakValue object.
 
Methods inherited from class edu.toronto.cs.util.SoftHashMap
clear, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.HashMap
clone
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

SoftSoftHashMap

public SoftSoftHashMap()
Method Detail

get

public java.lang.Object get(java.lang.Object key)
Description copied from class: SoftHashMap
Gets the value the key is mapped to.

Specified by:
get in interface java.util.Map
Overrides:
get in class SoftHashMap
Returns:
the value the key was mapped to. It returns null if the key wasn't in this map, or if the mapped value was explicitly set to null.

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Here we put the key, value pair into the HashMap using a WeakValue object.

Specified by:
put in interface java.util.Map
Overrides:
put in class SoftHashMap
Parameters:
key - the key, may be null
value - the value, may be null
Returns:
the value the key was mapped to previously. It returns null if the key wasn't in this map, or if the mapped value was explicitly set to null.