public final class TemperatureUnit extends java.lang.Object implements Unit<Temperature,TemperatureUnit>
TemperatureUnit convert to and from
degrees Kelvin.
Since May 2019, the kelvin and degree Celsius have been defined by taking a fixed numerical value of the Boltzmann
constant, k or kB. This change in definition acknowledges that temperature is fundamentally a measure of the average
energy of molecular motion.
(ref. npl.co.uk)ComparableUsing.EqualityMode, ComparableUsing.Operator| Modifier and Type | Field and Description |
|---|---|
static TemperatureUnit |
BASE |
static TemperatureUnit |
Celsius |
static TemperatureUnit |
Delisle |
static TemperatureUnit |
Fahrenheit |
static TemperatureUnit |
Kelvin |
static TemperatureUnit |
Newton |
static TemperatureUnit |
Rankine |
| Constructor and Description |
|---|
TemperatureUnit(java.util.function.Function<Rational,Rational> toK,
java.util.function.Function<Rational,Rational> fromK,
java.lang.String name,
java.lang.String symbol) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
Rational |
from(Temperature t) |
static TemperatureUnit |
get(java.util.function.Function<Rational,Rational> toK,
java.util.function.Function<Rational,Rational> fromK,
java.lang.String name,
java.lang.String symbol)
Get or create a unit using the
toK and fromK conversion functions. |
java.lang.String |
getName() |
java.lang.String |
getSymbol() |
int |
hashCode() |
Temperature |
makeDimension(java.lang.Number amount) |
EnergyUnit |
times(HeatCapacityUnit c) |
Rational |
toBaseUnits(Rational myUnits) |
Rational |
toNumber() |
clone, finalize, getClass, jailbreak, notify, notifyAll, toString, wait, wait, waitcompareTo, copy, fromNumber, getFullName, getFullSymbol, postfixBinddiv, div, minus, plus, rem, rem, times, toBaseNumber, unaryMinuscompareToUsing, equalityModepublic static final TemperatureUnit Kelvin
public static final TemperatureUnit Celsius
public static final TemperatureUnit Fahrenheit
public static final TemperatureUnit Rankine
public static final TemperatureUnit Delisle
public static final TemperatureUnit Newton
public static final TemperatureUnit BASE
public static TemperatureUnit get(java.util.function.Function<Rational,Rational> toK, java.util.function.Function<Rational,Rational> fromK, java.lang.String name, java.lang.String symbol)
toK and fromK conversion functions. The specified unit is cached
based on the name and symbol and will be returned for subsequent calls to this method if
name and symbol match.
toK - A function to convert the named unit to degrees Kelvin.fromK - A function to convert from degrees Kelvin to degrees of the named unit.name - The standard full name of the unit e.g., "Celsius".symbol - The standard symbol used for the unit e.g., "°C".public Temperature makeDimension(java.lang.Number amount)
makeDimension in interface Unit<Temperature,TemperatureUnit>public java.lang.String getName()
getName in interface Unit<Temperature,TemperatureUnit>public java.lang.String getSymbol()
getSymbol in interface Unit<Temperature,TemperatureUnit>public Rational toBaseUnits(Rational myUnits)
toBaseUnits in interface Unit<Temperature,TemperatureUnit>myUnits - A magnitude of these units to convert to base units.theseUnits converted to the base units of this unit type.public Rational toNumber()
toNumber in interface Dimension<TemperatureUnit>public Rational from(Temperature t)
from in interface Unit<Temperature,TemperatureUnit>public EnergyUnit times(HeatCapacityUnit c)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2022. All rights reserved.