com.openharbor.beck.map
Class HashableSoftReference

java.lang.Object
  extended byjava.lang.ref.Reference
      extended byjava.lang.ref.SoftReference
          extended bycom.openharbor.beck.map.HashableSoftReference

public class HashableSoftReference
extends java.lang.ref.SoftReference

A SoftReference that can be used as a key in a HashMap. The hashCode and equals methods delegate to the referent. Garbage collection doesn't cause the hashCode to change (assuming the referent's hashCode doesn't change).


Constructor Summary
HashableSoftReference(java.lang.Object referent)
           
HashableSoftReference(java.lang.Object referent, java.lang.ref.ReferenceQueue epitaph)
           
 
Method Summary
 boolean equals(java.lang.Object that)
           
 int hashCode()
           
 
Methods inherited from class java.lang.ref.SoftReference
get
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, isEnqueued
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashableSoftReference

public HashableSoftReference(java.lang.Object referent)
                      throws java.lang.NullPointerException
Throws:
java.lang.NullPointerException - if referent == null.

HashableSoftReference

public HashableSoftReference(java.lang.Object referent,
                             java.lang.ref.ReferenceQueue epitaph)
                      throws java.lang.NullPointerException
Throws:
java.lang.NullPointerException - if referent == null.
Method Detail

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object that)