Java Platform 1.2
Beta 4

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 soft 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 Summary
WeakReference(Object referent, ReferenceQueue q)
          Create a new weak reference that refers to the given object and is registered with the given queue.
WeakReference(Object referent)
          Create a new weak reference that refers to the given object.
 
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 any 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

Java Platform 1.2
Beta 4

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.
This documentation was generated with a post-Beta4 version of Javadoc.