Package com.ms.vm Previous
Previous
Contents
Contents
Index
Index

Class WeakReference

Constructors , Methods

public class WeakReference {
  // Constructors
  public WeakReference(Object referent)
  // Methods
  public synchronized Object getReferent()
  public synchronized void finalize()
}

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 synchronized void finalize()

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


getReferent

public synchronized Object getReferent()

Returns the current object being tracked.

Return Value:

Returns the object being tracked or null if the object was collected.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.