java.lang.ref
public
abstract
class
java.lang.ref.Reference
Abstract class which describes behavior common to all reference objects.
Known Direct Subclasses
| PhantomReference |
PhantomReference objects are used to detect referents which are no longer
visible and are eligible to have their storage reclaimed. |
| SoftReference |
SoftReference objects are used to detect referents which are no longer
visible and who's memory is to be reclaimed. |
| WeakReference |
WeakReference objects are used to detect referents which are no longer
visible. |
Known Indirect Subclasses
Summary
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
public
void
clear()
Make the referent null. This does not force the reference object to be
enqueued.
public
boolean
enqueue()
Force the reference object to be enqueued if it has been associated with
a queue.
Returns
- boolean true if Reference is enqueued. false otherwise.
public
T
get()
Return the referent of the reference object.
Returns
- Referent to which reference refers, or null if object has been
cleared.
public
boolean
isEnqueued()
Return whether the reference object has been enqueued.
Returns
- boolean true if Reference has been enqueued. false otherwise.