All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.lang.ref.WeakReference

java.lang.Object
    |
    +----java.lang.ref.Reference
            |
            +----java.lang.ref.WeakReference

public class WeakReference
extends Reference
Weak reference objects, for use in implementing simple caches and canonicalizing mappings.

A weak reference is a reference object that does not prevent its referent from being made finalizable, finalized, and then reclaimed. If the garbage collector determines at a certain point in time that an object is no longer strongly reachable and has no guarded references, then at that time it will clear all weak references to the object and declare the object to be finalizable. If a weak reference is registered at the moment the garbage collector clears it, then at some later time it will be enqueued.

Since:
JDK1.2
See Also:
Reference

Constructor Index

 o WeakReference(Object)
Create a new weak reference that refers to the given object.
 o WeakReference(Object, ReferenceQueue)
Create a new weak reference that refers to the given object and is registered with the given queue.

Constructors

 o WeakReference
public WeakReference(Object referent)
Create a new weak reference that refers to the given object. The new reference is not registered with any queue.

 o WeakReference
public WeakReference(Object referent,
                     ReferenceQueue q)
Create a new weak reference that refers to the given object and is registered with the given queue.

Throws: NullPointerException
If the queue argument is null

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature