- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.WeakReference<T>
-
public class WeakReference<T> extends Reference<T>
WeakReference objects are used to detect referents which are no longer visible.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description WeakReference(T r)
Constructs a new instance of this class.WeakReference(T r, ReferenceQueue<? super T> q)
Constructs a new instance of this class.
-
-
-
Constructor Detail
-
WeakReference
public WeakReference(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.
-
WeakReference
public WeakReference(T r)
Constructs a new instance of this class.- Parameters:
r
- referent to track.
-
-