java.lang.ref
public class PhantomReference<T> extends Reference<T>
get()
always
returns null.
Constructor Summary | |
---|---|
PhantomReference(T referent, ReferenceQueue<? super T> q)
Creates a new phantom reference. |
Method Summary | |
---|---|
T | get()
Returns the object, this reference refers to. |
Parameters: referent the object that should be watched. q the queue that should be notified, if the referent was
finalized. This mustn't be null
.
Throws: NullPointerException if q is null.
Returns: null
, since the refered object may be
finalized and thus not accessible.