Build 1.0_r1(from source)

java.lang.ref
Class PhantomReference<T>

java.lang.Object
  extended by java.lang.ref.Reference<T>
      extended by java.lang.ref.PhantomReference<T>

public class PhantomReference<T>
extends Reference<T>

Implements a phantom reference, which is the weakest of the three types of references. Once the garbage collector decides that an object obj is Object.finalize() method.

Since:
Android 1.0

Field Summary
 
Fields inherited from class java.lang.ref.Reference
queue, queueNext, referent
 
Constructor Summary
PhantomReference(T r, ReferenceQueue<? super T> q)
          Constructs a new phantom reference and registers it with the given reference queue.
 
Method Summary
 T get()
          Returns null.
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, isEnqueued
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhantomReference

public PhantomReference(T r,
                        ReferenceQueue<? super T> q)
Constructs a new phantom reference and registers it with the given reference queue. The reference queue may be null, but this case does not make any sense, since the reference will never be enqueued, and the get() method always returns null.

Parameters:
r - the referent to track
q - the queue to register the phantom reference object with
Since:
Android 1.0
Method Detail

get

public T get()
Returns null. The referent of a phantom reference is not accessible.

Overrides:
get in class Reference<T>
Returns:
null (always)
Since:
Android 1.0

Build 1.0_r1(from source)

Please submit a feedback, bug or feature