Main Page | Class Hierarchy | Class List | Directories | Class Members | Related Pages

java.lang.ref.Reference Class Reference

Inheritance diagram for java.lang.ref.Reference:

java.lang.Object java.lang.ref.PhantomReference java.lang.ref.SoftReference java.lang.ref.WeakReference 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:
JDK1.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.
Object get ()
 Return the referent of the reference object.
boolean isEnqueued ()
 Return whether the reference object has been enqueued.

Package Functions

boolean enqueueImpl ()
 Enqueue the reference object on the associated queue.
 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 q)
 Implement this method to support the provided subclass implementations.
void dequeue ()
 Called when a Reference has been removed from its ReferenceQueue.


Constructor & Destructor Documentation

java.lang.ref.Reference.Reference  )  [package]
 

Constructs a new instance of this class.


Member Function Documentation

void java.lang.ref.Reference.clear  ) 
 

Make the referent null.

This does not force the reference object to be enqueued.

boolean java.lang.ref.Reference.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.

Object java.lang.ref.Reference.get  ) 
 

Return the referent of the reference object.

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

Reimplemented in java.lang.ref.PhantomReference, and java.lang.ref.SoftReference.

boolean java.lang.ref.Reference.isEnqueued  ) 
 

Return whether the reference object has been enqueued.

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

boolean java.lang.ref.Reference.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.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.initReference Object  r,
ReferenceQueue  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

void java.lang.ref.Reference.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:
(c) Copyright 2005 The Apache Software Foundation or its licensors, as applicable.