Energy
public final class Energy implements Comparable
Represents a unit of energy. Supported units:
-
calories - see
Energy.calories,Double.calories -
kilocalories - see
Energy.kilocalories,Double.kilocalories -
joules - see
Energy.joules,Double.joules -
kilojoules - see
Energy.kilojoules,Double.kilojoules
Summary
Public methods |
|
|---|---|
static final @NonNull Energy |
calories(double value)Creates |
int |
|
boolean |
|
final double |
Returns the energy in calories. |
final double |
Returns the energy in joules. |
final double |
Returns the energy in kilocalories. |
final double |
Returns the energy in kilojoules. |
int |
hashCode() |
static final @NonNull Energy |
joules(double value)Creates |
static final @NonNull Energy |
kilocalories(double value)Creates |
static final @NonNull Energy |
kilojoules(double value)Creates |
@NonNull String |
toString() |
Public methods
calories
public static final @NonNull Energy calories(double value)
Creates Energy with the specified value in calories.
getKilocalories
public final double getKilocalories()
Returns the energy in kilocalories.
joules
public static final @NonNull Energy joules(double value)
Creates Energy with the specified value in joules.
kilocalories
public static final @NonNull Energy kilocalories(double value)
Creates Energy with the specified value in kilocalories.
kilojoules
public static final @NonNull Energy kilojoules(double value)
Creates Energy with the specified value in kilojoules.