Build 1.0_r1(from source)

Class PhantomReference<T>

  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.

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


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.

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


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

get in class Reference<T>
null (always)
Android 1.0

Build 1.0_r1(from source)

Please submit a feedback, bug or feature