FileDocCategorySizeDatePackage
WeakReference.javaAPI DocphoneME MR2 API (J2ME)2779Wed May 02 17:59:56 BST 2007java.lang.ref

WeakReference

public class WeakReference extends Reference
This class provides support for weak references. Weak references are most often used to implement canonicalizing mappings. Suppose that the garbage collector determines at a certain point in time that an object is weakly reachable. At that time it will atomically clear all the weak references to that object and all weak references to any other weakly- reachable objects from which that object is reachable through a chain of strong and weak references.
version
12/19/01 (CLDC 1.1)
since
JDK1.2, CLDC 1.1

Fields Summary
private int
referent_index
Constructors Summary
public WeakReference(Object referent)
Creates a new weak reference that refers to the given object.

        super(referent);
        initializeWeakReference(referent);
    
Methods Summary
public native voidclear()
Clears this reference object.

private native voidfinalize()

public native java.lang.Objectget()
Returns this reference object's referent. If this reference object has been cleared, either by the program or by the garbage collector, then this method returns null.

return
The object to which this reference refers, or null if this reference object has been cleared

private native voidinitializeWeakReference(java.lang.Object referent)