- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.PhantomReference<T>
-
public class PhantomReference<T> extends Reference<T>
PhantomReference objects are used to detect referents which are no longer visible and are eligible to have their storage reclaimed.- Since:
- JDK1.2
-
-
Constructor Summary
Constructors Constructor Description PhantomReference(T r, ReferenceQueue<? super T> q)
Constructs a new instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
Return the referent of the reference object.-
Methods declared in class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence
-
-
-
-
Constructor Detail
-
PhantomReference
public PhantomReference(T r, ReferenceQueue<? super T> q)
Constructs a new instance of this class.- Parameters:
r
- referent to track.q
- queue to register to the reference object with.
-
-