java.lang.ref
Class PhantomReference<T>
java.lang.Object
java.lang.ref.Reference<T>
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
|
Method Summary |
T |
get()
Returns null. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 trackq - the queue to register the phantom reference object with- Since:
- Android 1.0
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
Please submit a feedback, bug or feature