java.lang.ref
Class Reference<T>

java.lang.Object
  extended by java.lang.ref.Reference<T>
Type Parameters:
T - Type of object that is referent.
Direct Known Subclasses:
WeakReference

public abstract class Reference<T>
extends Object

Base class for references.


Field Summary
protected  T ref
          Referent for this Reference object.
 
Constructor Summary
Reference()
           
 
Method Summary
 void clear()
          Clear the referent that this Reference refers to.
 boolean enqueue()
          Enqueue this reference into a reference queue.
 T get()
          Gets the referent for this Reference.
 boolean isEnqueued()
          Get the status of the Reference object in the queue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected T ref
Referent for this Reference object.

Constructor Detail

Reference

public Reference()
Method Detail

clear

public void clear()
Clear the referent that this Reference refers to.


enqueue

public boolean enqueue()
Enqueue this reference into a reference queue.

Returns:
true if the reference is enqueued
Throws:
UnsupportedOperationException - if not supported by the VM.

get

public T get()
Gets the referent for this Reference.

Returns:
referent of type T

isEnqueued

public boolean isEnqueued()
Get the status of the Reference object in the queue.

Returns:
true if the Reference is enqueued


Copyright © 2007 Sentilla Corporation. All Rights Reserved.