Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

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 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, simultaneously and atomically from the standpoint of the program. The collector will then declare the object to be finalizable. If any of the weak references were registered with reference queues, they will be enqueued at that time or some later time.

Since:
JDK1.2

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

Methods inherited from class java.lang.ref.Reference
 clear, enqueue, get, isEnqueued
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakReference

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

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

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.