English | Site Directory

Android - An Open Handset Alliance Project

java.lang.ref
public class

java.lang.ref.SoftReference

java.lang.Object
java.lang.ref.Reference
java.lang.ref.SoftReference

SoftReference objects are used to detect referents which are no longer visible and who's memory is to be reclaimed.

Summary

Public Constructors

          SoftReference(T r)
Constructs a new instance of this class.
          SoftReference(T r, ReferenceQueue q)
Constructs a new instance of this class.

Public Methods

        T  get()
Return the referent of the reference object.
Methods inherited from class java.lang.ref.Reference
Methods inherited from class java.lang.Object

Details

Public Constructors

public SoftReference(T r)

Constructs a new instance of this class.

Parameters

r referent to track.

public SoftReference(T r, ReferenceQueue q)

Constructs a new instance of this class.

Parameters

r referent to track.
q queue to register to the reference object with.

Public Methods

public T get()

Return the referent of the reference object.

Returns

  • Object Referent to which reference refers, or null if object has been cleared.
Build m5-rc15i - 10 Jun 2008 13:54