Packages
 In this topic

*Constructors

*Methods

 

Packages   Previous This Package
Package com.ms.vm   Previous This
Package

 


Class WeakReference

public class WeakReference
{
  // Constructors
  public WeakReference(Object referent);

  // Methods
  public void finalize();
  public Object getReferent();
  public void setReferent(Object object);
}

This class implements a weak reference to an object. A weak reference tracks an object without preventing it from being garbage-collected.

Constructors

WeakReference

public WeakReference(Object referent);

Constructs a weak reference to a specified object.

ParameterDescription
referent The object to track.

Methods

finalize

public void finalize();

Finalizes the weak reference instance. The referent is no longer tracked.

Return Value:

No return value.

getReferent

public Object getReferent();

Retrieves the current object being tracked.

Return Value:

Returns the object being tracked; returns null if the object was collected.

setReferent

public void setReferent(Object object);

Sets the current object being tracked.

Return Value:

No return value.

ParameterDescription
object The object being tracked, or null if the object was collected.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.