aicas logo Jamaica 3.4 release 8

java.lang.ref
Class Reference<T>

java.lang.Object
  extended by java.lang.ref.Reference<T>
Direct Known Subclasses:
PhantomReference, SoftReference, WeakReference

public abstract class Reference<T>
extends Object

Reference is the common abstract super class for reference types WeakReference, SoftReference and PhantomReference.

This class may not be extended by user defined classes.

Since:
1.2

Method Summary
 void clear()
          Clear this reference, i.e., ensure that get() returns null.
 boolean enqueue()
          Enqueues this Reference on its associated ReferenceQueue.
protected  void finalize()
          finalize method.
 T get()
          Return the value of this reference if it is still alive, or null if it was deleted.
 boolean isEnqueued()
          Test if this reference has been enqueued to its reference queue.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public T get()
Return the value of this reference if it is still alive, or null if it was deleted.

Returns:
the value of this reference or null.

clear

public void clear()
Clear this reference, i.e., ensure that get() returns null.

This method does not enqueue this reference.


isEnqueued

public boolean isEnqueued()
Test if this reference has been enqueued to its reference queue.

Returns:
true if this reference has an attached ReferenceQueue and it was enqueued.

enqueue

public boolean enqueue()
Enqueues this Reference on its associated ReferenceQueue.

For JamaicaVM, this method synchronized on the reference queue attached to this object for atomicity.

Returns:
false if no ReferenceQueue is associated or this Refernce was already enqueued.

finalize

protected void finalize()
                 throws Throwable
finalize method.

Overrides:
finalize in class Object
Throws:
Throwable - this method may throw any exception, it will be ignored by the finalizer thread or by Runtime.runFinalization.

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.