java.lang.ref
public class SoftReference<T> extends Reference<T>
Constructor Summary | |
---|---|
SoftReference(T referent)
Create a new soft reference, that is not registered to any queue. | |
SoftReference(T referent, ReferenceQueue<? super T> q)
Create a new soft reference. |
Method Summary | |
---|---|
T | get()
Returns the object, this reference refers to. |
Parameters: referent the object we refer to.
Parameters: referent the object we refer to. q the reference queue to register on.
Throws: NullPointerException if q is null.
Returns: the object, this reference refers to, or null if the reference was cleared.