edu.toronto.cs.util
Class SoftSoftHashMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap
edu.toronto.cs.util.SoftHashMap
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 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> |
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 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 |
SoftSoftHashMap
public SoftSoftHashMap()
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 nullvalue
- 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.