Class: Toybox::Lang::Object

Inherits:
Object
  • Object
show all

Overview

Object is the root object for the Monkey C class hierarchy.

Since:

  • 1.0.0

Direct Known Subclasses

Activity::Info, ActivityMonitor::ActiveMinutes, ActivityMonitor::HeartRateIterator, ActivityMonitor::HeartRateSample, ActivityMonitor::History, ActivityMonitor::Info, ActivityRecording::Session, Ant::BurstListener, Ant::BurstPayload, Ant::BurstPayloadIterator, Ant::ChannelAssignment, Ant::CryptoConfig, Ant::DeviceConfig, Ant::GenericChannel, Ant::Message, AntPlus::BikeCadenceInfo, AntPlus::BikeSpeedCadenceInfo, AntPlus::BikeSpeedInfo, AntPlus::CalculatedCadence, AntPlus::CalculatedPower, AntPlus::CalculatedWheelDistance, AntPlus::CalculatedWheelSpeed, AntPlus::CommonData, AntPlus::DerailleurStatus, AntPlus::Device, AntPlus::DeviceListener, AntPlus::DeviceState, AntPlus::FitnessEquipmentData, AntPlus::FitnessEquipmentMode, AntPlus::PedalPowerBalance, AntPlus::RadarTarget, AntPlus::ResistanceSettings, AntPlus::RunningDynamicsData, AntPlus::SensorPosition, AntPlus::ShiftingStatus, AntPlus::SimulationSettings, AntPlus::TargetPowerSettings, AntPlus::TorqueEffectivenessPedalSmoothness, AntPlus::UserSettings, Application::AppBase, Attention::ToneProfile, Attention::VibeProfile, BluetoothLowEnergy::BleDelegate, BluetoothLowEnergy::Characteristic, BluetoothLowEnergy::Descriptor, BluetoothLowEnergy::Device, BluetoothLowEnergy::Iterator, BluetoothLowEnergy::ScanResult, BluetoothLowEnergy::Service, BluetoothLowEnergy::Uuid, Communications::ConnectionListener, Communications::MailboxIterator, Communications::Message, Communications::SyncDelegate, Cryptography::Cipher, Cryptography::CipherBasedMessageAuthenticationCode, Cryptography::Hash, Cryptography::HashBasedMessageAuthenticationCode, Cryptography::Key, Cryptography::KeyAgreement, Cryptography::KeyPair, FitContributor::Field, Graphics::BufferedBitmap, Graphics::Dc, Array, Boolean, ByteArray, Char, Dictionary, Double, Exception, Float, Long, Method, Number, String, Symbol, WeakReference, Math::Filter, Media::AlbumArt, Media::AudioFormat, Media::CacheStatistics, Media::Content, Media::ContentDelegate, Media::ContentIterator, Media::ContentMetadata, Media::ContentRef, Media::ContentRefIterator, Media::CustomButton, Media::PlaybackProfile, Media::PlayerColors, Media::ProviderIconInfo, Media::SyncDelegate, Media::SystemButton, PersistedContent::Course, PersistedContent::Iterator, PersistedContent::Route, PersistedContent::Track, PersistedContent::Waypoint, PersistedContent::Workout, Position::Info, Position::Location, Sensor::AccelerometerData, Sensor::HeartRateData, Sensor::Info, Sensor::SensorData, SensorHistory::SensorHistoryIterator, SensorHistory::SensorSample, SensorLogging::SensorLogger, SensorLogging::SensorLoggingStats, System::ClockTime, System::ConnectionInfo, System::DeviceSettings, System::Intent, System::ServiceDelegate, System::Stats, Test::Logger, Time::Duration, Time::Gregorian::Info, Time::Moment, Timer::Timer, UserProfile::Profile, WatchUi::AnimationDelegate, WatchUi::AnimationResource, WatchUi::BitmapResource, WatchUi::ClickEvent, WatchUi::Confirmation, WatchUi::ConfirmationDelegate, WatchUi::Drawable, WatchUi::FontResource, WatchUi::GlanceViewDelegate, WatchUi::InputDelegate, WatchUi::KeyEvent, WatchUi::Layer, WatchUi::MapMarker, WatchUi::MapPolyline, WatchUi::Menu, WatchUi::Menu2InputDelegate, WatchUi::MenuInputDelegate, WatchUi::MenuItem, WatchUi::NumberPicker, WatchUi::NumberPickerDelegate, WatchUi::PickerDelegate, WatchUi::PickerFactory, WatchUi::ProgressBar, WatchUi::SelectableEvent, WatchUi::SwipeEvent, WatchUi::TextPicker, WatchUi::TextPickerDelegate, WatchUi::View, WatchUi::WatchFaceDelegate, WatchUi::WatchFacePowerInfo

Direct Known Subclasses

Activity::Info, ActivityMonitor::ActiveMinutes, ActivityMonitor::HeartRateIterator, ActivityMonitor::HeartRateSample, ActivityMonitor::History, ActivityMonitor::Info, ActivityRecording::Session, Ant::BurstListener, Ant::BurstPayload, Ant::BurstPayloadIterator, Ant::ChannelAssignment, Ant::CryptoConfig, Ant::DeviceConfig, Ant::GenericChannel, Ant::Message, AntPlus::BikeCadenceInfo, AntPlus::BikeSpeedCadenceInfo, AntPlus::BikeSpeedInfo, AntPlus::CalculatedCadence, AntPlus::CalculatedPower, AntPlus::CalculatedWheelDistance, AntPlus::CalculatedWheelSpeed, AntPlus::CommonData, AntPlus::DerailleurStatus, AntPlus::Device, AntPlus::DeviceListener, AntPlus::DeviceState, AntPlus::FitnessEquipmentData, AntPlus::FitnessEquipmentMode, AntPlus::PedalPowerBalance, AntPlus::RadarTarget, AntPlus::ResistanceSettings, AntPlus::RunningDynamicsData, AntPlus::SensorPosition, AntPlus::ShiftingStatus, AntPlus::SimulationSettings, AntPlus::TargetPowerSettings, AntPlus::TorqueEffectivenessPedalSmoothness, AntPlus::UserSettings, Application::AppBase, Attention::ToneProfile, Attention::VibeProfile, BluetoothLowEnergy::BleDelegate, BluetoothLowEnergy::Characteristic, BluetoothLowEnergy::Descriptor, BluetoothLowEnergy::Device, BluetoothLowEnergy::Iterator, BluetoothLowEnergy::ScanResult, BluetoothLowEnergy::Service, BluetoothLowEnergy::Uuid, Communications::ConnectionListener, Communications::MailboxIterator, Communications::Message, Communications::SyncDelegate, Cryptography::Cipher, Cryptography::CipherBasedMessageAuthenticationCode, Cryptography::Hash, Cryptography::HashBasedMessageAuthenticationCode, Cryptography::Key, Cryptography::KeyAgreement, Cryptography::KeyPair, FitContributor::Field, Graphics::BufferedBitmap, Graphics::Dc, Array, Boolean, ByteArray, Char, Dictionary, Double, Exception, Float, Long, Method, Number, String, Symbol, WeakReference, Math::Filter, Media::AlbumArt, Media::AudioFormat, Media::CacheStatistics, Media::Content, Media::ContentDelegate, Media::ContentIterator, Media::ContentMetadata, Media::ContentRef, Media::ContentRefIterator, Media::CustomButton, Media::PlaybackProfile, Media::PlayerColors, Media::ProviderIconInfo, Media::SyncDelegate, Media::SystemButton, PersistedContent::Course, PersistedContent::Iterator, PersistedContent::Route, PersistedContent::Track, PersistedContent::Waypoint, PersistedContent::Workout, Position::Info, Position::Location, Sensor::AccelerometerData, Sensor::HeartRateData, Sensor::Info, Sensor::SensorData, SensorHistory::SensorHistoryIterator, SensorHistory::SensorSample, SensorLogging::SensorLogger, SensorLogging::SensorLoggingStats, System::ClockTime, System::ConnectionInfo, System::DeviceSettings, System::Intent, System::ServiceDelegate, System::Stats, Test::Logger, Time::Duration, Time::Gregorian::Info, Time::Moment, Timer::Timer, UserProfile::Profile, WatchUi::AnimationDelegate, WatchUi::AnimationResource, WatchUi::BitmapResource, WatchUi::ClickEvent, WatchUi::Confirmation, WatchUi::ConfirmationDelegate, WatchUi::Drawable, WatchUi::FontResource, WatchUi::GlanceViewDelegate, WatchUi::InputDelegate, WatchUi::KeyEvent, WatchUi::Layer, WatchUi::MapMarker, WatchUi::MapPolyline, WatchUi::Menu, WatchUi::Menu2InputDelegate, WatchUi::MenuInputDelegate, WatchUi::MenuItem, WatchUi::NumberPicker, WatchUi::NumberPickerDelegate, WatchUi::PickerDelegate, WatchUi::PickerFactory, WatchUi::ProgressBar, WatchUi::SelectableEvent, WatchUi::SwipeEvent, WatchUi::TextPicker, WatchUi::TextPickerDelegate, WatchUi::View, WatchUi::WatchFaceDelegate, WatchUi::WatchFacePowerInfo

Instance Method Summary collapse

Instance Method Details

equals(object) ⇒ Toybox::Lang::Boolean

Test if an Object instance is equal to another instance of an Object.

Examples:

var a = 1;
var b = 1;
var c = 1.0;
a.equals(b); // returns true
a.equals(c); // returns false

Parameters:

Returns:

Since:

  • 1.0.0


6266
6267
# File 'Monkeybrains.rb', line 6266

def equals(object)
end

hashCodeToybox::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

Returns:

See Also:

Since:

  • 1.0.0


6252
6253
# File 'Monkeybrains.rb', line 6252

def hashCode()
end

method(methodName) ⇒ Toybox::Lang::Method

Retrieve a callback to a Method.

This is typically used when supplying a callback function to another method.

Parameters:

Returns:

See Also:

Since:

  • 1.0.0


6238
6239
# File 'Monkeybrains.rb', line 6238

def method(methodName)
end

toStringToybox::Lang::String

Convert an Object to a String.

Examples:

var myNumber = 3219;
var myString = myNumber.toString();

Returns:

Since:

  • 1.0.0


6228
6229
# File 'Monkeybrains.rb', line 6228

def toString()
end

weakToybox::Lang::WeakReference

Note:

Immutable types (Number, Float, Long, Double, Boolean, String) will return their values. Other Object types will return a WeakReference object.

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.

Returns:

See Also:

Since:

  • 1.2.0


6280
6281
# File 'Monkeybrains.rb', line 6280

def weak()
end