public final class TemperatureUnit extends 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(Function<Rational,Rational> toK,
Function<Rational,Rational> fromK,
String name,
String symbol) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Rational |
from(Temperature t) |
static TemperatureUnit |
get(Function<Rational,Rational> toK,
Function<Rational,Rational> fromK,
String name,
String symbol)
Get or create a unit using the
toK and fromK conversion functions. |
String |
getName() |
String |
getSymbol() |
int |
hashCode() |
Temperature |
makeDimension(Number amount) |
EnergyUnit |
times(HeatCapacityUnit c) |
Rational |
toBaseUnits(Rational myUnits) |
Rational |
toNumber() |
clone, emptyArray, finalize, getClass, jailbreak, notify, notifyAll, toString, wait, wait, wait
compareTo, copy, fromNumber, getFullName, getFullSymbol, postfixBind
div, div, minus, plus, rem, rem, times, toBaseNumber, unaryMinus
compareToUsing, equalityMode
public 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(Function<Rational,Rational> toK, Function<Rational,Rational> fromK, String name, 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(Number amount)
makeDimension
in interface Unit<Temperature,TemperatureUnit>
public String getName()
getName
in interface Unit<Temperature,TemperatureUnit>
public 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)
Copyright © 2024. All rights reserved.