class Mass : Comparable


Represents a unit of mass. Supported units:

Summary

Public companion functions

Mass
grams(value: Double)

Creates Mass with the specified value in grams.

Mass
kilograms(value: Double)

Creates Mass with the specified value in kilograms.

Mass

Creates Mass with the specified value in micrograms.

Mass

Creates Mass with the specified value in milligrams.

Mass
ounces(value: Double)

Creates Mass with the specified value in ounces.

Mass
pounds(value: Double)

Creates Mass with the specified value in pounds.

Public functions

open operator Int
compareTo(other: Mass)
open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Double

Returns the mass in grams.

Double

Returns the mass in kilograms.

Double

Returns the mass in micrograms.

Double

Returns the mass in milligrams.

Double

Returns the mass in ounces.

Double

Returns the mass in pounds.

Public companion functions

grams

Added in 1.1.0-alpha07
fun grams(value: Double): Mass

Creates Mass with the specified value in grams.

kilograms

Added in 1.1.0-alpha07
fun kilograms(value: Double): Mass

Creates Mass with the specified value in kilograms.

micrograms

Added in 1.1.0-alpha07
fun micrograms(value: Double): Mass

Creates Mass with the specified value in micrograms.

milligrams

Added in 1.1.0-alpha07
fun milligrams(value: Double): Mass

Creates Mass with the specified value in milligrams.

ounces

Added in 1.1.0-alpha07
fun ounces(value: Double): Mass

Creates Mass with the specified value in ounces.

pounds

Added in 1.1.0-alpha07
fun pounds(value: Double): Mass

Creates Mass with the specified value in pounds.

Public functions

compareTo

Added in 1.1.0-alpha07
open operator fun compareTo(other: Mass): Int

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

inGrams

Added in 1.1.0-alpha07
val inGramsDouble

Returns the mass in grams.

inKilograms

Added in 1.1.0-alpha07
val inKilogramsDouble

Returns the mass in kilograms.

inMicrograms

Added in 1.1.0-alpha07
val inMicrogramsDouble

Returns the mass in micrograms.

inMilligrams

Added in 1.1.0-alpha07
val inMilligramsDouble

Returns the mass in milligrams.

inOunces

Added in 1.1.0-alpha07
val inOuncesDouble

Returns the mass in ounces.

inPounds

Added in 1.1.0-alpha07
val inPoundsDouble

Returns the mass in pounds.