Class: Toybox.Lang.WeakReference

Overview

A weak reference is a loosely bound reference to another object. If all strong references have been freed, the WeakReference.get() method will return null. This allows the developer to avoid circular references.

See Also:

Since:

API Level 1.2.0

Instance Method Summary collapse

Instance Method Details

get() as Lang.Object or Null

Get the Object referenced by the WeakReference

Returns:

  • Lang.Object

    The Object referenced, or null if the Object no longer exists

Since:

API Level 1.2.0

stillAlive() as Lang.Boolean

Determine whether a WeakReference is still alive.

Note:

I feel FANTASTIC and I am still alive. When you're dying I'll be still alive. And when you're dead I will be still alive.

Returns:

  • Lang.Boolean

    true if object is still alive, otherwise false

See Also:

Since:

API Level 1.2.0


Generated Sep 23, 2024, 3:32:49 PM