class Energy : Comparable


Represents a unit of energy. Supported units:

Summary

Public companion functions

Energy
calories(value: Double)

Creates Energy with the specified value in calories.

Energy
joules(value: Double)

Creates Energy with the specified value in joules.

Energy

Creates Energy with the specified value in kilocalories.

Energy

Creates Energy with the specified value in kilojoules.

Public functions

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

Public properties

Double

Returns the energy in calories.

Double

Returns the energy in joules.

Double

Returns the energy in kilocalories.

Double

Returns the energy in kilojoules.

Public companion functions

calories

Added in 1.1.0-alpha07
fun calories(value: Double): Energy

Creates Energy with the specified value in calories.

joules

Added in 1.1.0-alpha07
fun joules(value: Double): Energy

Creates Energy with the specified value in joules.

kilocalories

Added in 1.1.0-alpha07
fun kilocalories(value: Double): Energy

Creates Energy with the specified value in kilocalories.

kilojoules

Added in 1.1.0-alpha07
fun kilojoules(value: Double): Energy

Creates Energy with the specified value in kilojoules.

Public functions

compareTo

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

equals

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

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

inCalories

Added in 1.1.0-alpha07
val inCaloriesDouble

Returns the energy in calories.

inJoules

Added in 1.1.0-alpha07
val inJoulesDouble

Returns the energy in joules.

inKilocalories

Added in 1.1.0-alpha07
val inKilocaloriesDouble

Returns the energy in kilocalories.

inKilojoules

Added in 1.1.0-alpha07
val inKilojoulesDouble

Returns the energy in kilojoules.