Class: Toybox.Lang.Object
- Inherits:
-
Toybox.Lang.Object
Overview
Object is the root object for the Monkey C class hierarchy.
Instance Method Summary collapse
-
equals(other as Lang.Object or Null) as Lang.Boolean
Test if an Object instance is equal to another instance of an Object.
-
hashCode() as Lang.Number
Get a hash code value for an Object.
-
method(methodName as Lang.Symbol) as Lang.Method
Retrieve a callback to a Method.
-
toString() as Lang.String
Convert an Object to a String.
-
weak() as Lang.WeakReference
Get a WeakReference to an Object.
Instance Method Details
equals(other as Lang.Object or Null) as Lang.Boolean
Test if an Object instance is equal to another instance of an Object.
hashCode() as Lang.Number
Get a hash code value for an Object.
This computes a 32-bit Number that is typically used as an index when placing Objects into a Dictionary. Hash code values have the following characteristics:
-
The computed hash code is constant for the lifetime of an Object
-
If two Objects are equal, their hash codes will be equal
method(methodName as Lang.Symbol) as Lang.Method
Retrieve a callback to a Method.
This is typically used when supplying a callback function to another method.
toString() as Lang.String
Convert an Object to a String.
weak() as Lang.WeakReference
Get a WeakReference to an Object.
A weak reference is an object that keeps a reference to an object but does not increment the reference count. This means the object reference can be destroyed, so is a case that should be handled.
Immutable types (Number, Float, Long, Double, Boolean, String) will return their values. Other Object types will return a WeakReference object.