java.lang.ref.Reference< T > Class Reference

Inheritance diagram for java.lang.ref.Reference< T >:

java.lang.ref.PhantomReference< T > java.lang.ref.SoftReference< T > java.lang.ref.WeakReference< T >

List of all members.


Detailed Description

This class must be implemented by the vm vendor.

The documented methods must be implemented to support the provided subclass implementations. As the provided subclass implementations are trivial and simply call initReference(Object) and initReference(Object, ReferenceQueue) from their constructors, the vm vendor may elect to implement the subclasses as well. Abstract class which describes behavior common to all reference objects.

Since:
1.2

Public Member Functions

void clear ()
 Make the referent null.
boolean enqueue ()
 Force the reference object to be enqueued if it has been associated with a queue.
get ()
 Return the referent of the reference object.
boolean isEnqueued ()
 Return whether the reference object has been enqueued.

Package Functions

 Reference ()
 Constructs a new instance of this class.
void initReference (Object r)
 Implement this method to support the provided subclass implementations.
void initReference (Object r, ReferenceQueue<?super T > q)
 Implement this method to support the provided subclass implementations.
boolean enqueueImpl ()
 Enqueue the reference object on the associated queue.
void dequeue ()
 Called when a Reference has been removed from its ReferenceQueue.

Constructor & Destructor Documentation

java.lang.ref.Reference< T >.Reference (  )  [package]

Constructs a new instance of this class.


Member Function Documentation

void java.lang.ref.Reference< T >.clear (  ) 

Make the referent null.

This does not force the reference object to be enqueued.

boolean java.lang.ref.Reference< T >.enqueue (  ) 

Force the reference object to be enqueued if it has been associated with a queue.

Returns:
boolean true if Reference is enqueued. false otherwise.

T java.lang.ref.Reference< T >.get (  ) 

Return the referent of the reference object.

Returns:
Referent to which reference refers, or null if object has been cleared.

Reimplemented in java.lang.ref.PhantomReference< T >, and java.lang.ref.SoftReference< T >.

boolean java.lang.ref.Reference< T >.isEnqueued (  ) 

Return whether the reference object has been enqueued.

Returns:
boolean true if Reference has been enqueued. false otherwise.

void java.lang.ref.Reference< T >.initReference ( Object  r  )  [package]

Implement this method to support the provided subclass implementations.

Initialize a newly created reference object. Associate the reference object with the referent.

Parameters:
r the referent

void java.lang.ref.Reference< T >.initReference ( Object  r,
ReferenceQueue<?super T >  q 
) [package]

Implement this method to support the provided subclass implementations.

Initialize a newly created reference object. Associate the reference object with the referent, and the specified ReferenceQueue.

Parameters:
r the referent
q the ReferenceQueue

boolean java.lang.ref.Reference< T >.enqueueImpl (  )  [package]

Enqueue the reference object on the associated queue.

Returns:
boolean true if the Reference was successfully enqueued. false otherwise.

void java.lang.ref.Reference< T >.dequeue (  )  [package]

Called when a Reference has been removed from its ReferenceQueue.

Set the enqueued field to false.


The documentation for this class was generated from the following file:

Genereated on Tue Dec 9 14:09:48 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.