public non-sealed 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
Constructs a new instance of this class.
-
Method Summary
Return the referent of the reference object.
-
Constructor Details
-
PhantomReference
Constructs a new instance of this class.
- Parameters:
r - referent to track.
q - queue to register to the reference object with.
-
Method Details
-
get
Return the referent of the reference object. Phantom reference
objects referents are inaccessible, and so null is returned.
- Overrides:
get in class Reference<T>
- Returns:
- Object
Returns null.