org.jscience.util.cache
Class KeyedWeakReference

java.lang.Object
  extended by java.lang.ref.Reference<T>
      extended by java.lang.ref.WeakReference
          extended by org.jscience.util.cache.KeyedWeakReference

public class KeyedWeakReference
extends java.lang.ref.WeakReference

Subclass of WeakReference which includes and extra field (the key) which can be used to help cleanup once this reference has been enqueued.

Since:
1.3

Constructor Summary
KeyedWeakReference(java.lang.Object key, java.lang.Object ref)
          Creates a new KeyedWeakReference object.
KeyedWeakReference(java.lang.Object key, java.lang.Object ref, java.lang.ref.ReferenceQueue queue)
          Creates a new KeyedWeakReference object.
 
Method Summary
 java.lang.Object getKey()
          DOCUMENT ME!
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, get, isEnqueued
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyedWeakReference

public KeyedWeakReference(java.lang.Object key,
                          java.lang.Object ref)
Creates a new KeyedWeakReference object.

Parameters:
key - DOCUMENT ME!
ref - DOCUMENT ME!

KeyedWeakReference

public KeyedWeakReference(java.lang.Object key,
                          java.lang.Object ref,
                          java.lang.ref.ReferenceQueue queue)
Creates a new KeyedWeakReference object.

Parameters:
key - DOCUMENT ME!
ref - DOCUMENT ME!
queue - DOCUMENT ME!
Method Detail

getKey

public java.lang.Object getKey()
DOCUMENT ME!

Returns:
DOCUMENT ME!