Temperature
public final class Temperature implements Comparable
Represents a unit of temperature. Supported units:
-
Celsius - see
Temperature.celsius,Double.celsius -
Fahrenheit - see
Temperature.fahrenheit,Double.fahrenheit
Summary
Public methods |
|
|---|---|
static final @NonNull Temperature |
celsius(double value)Creates |
int |
compareTo(@NonNull Temperature other) |
boolean |
|
static final @NonNull Temperature |
fahrenheit(double value)Creates |
final double |
Returns the temperature in Celsius degrees. |
final double |
Returns the temperature in Fahrenheit degrees. |
int |
hashCode() |
@NonNull String |
toString() |
Public methods
celsius
public static final @NonNull Temperature celsius(double value)
Creates Temperature with the specified value in Celsius degrees.
fahrenheit
public static final @NonNull Temperature fahrenheit(double value)
Creates Temperature with the specified value in Fahrenheit degrees.
getCelsius
public final double getCelsius()
Returns the temperature in Celsius degrees.
getFahrenheit
public final double getFahrenheit()
Returns the temperature in Fahrenheit degrees.