Package javax.measure.test.unit
Class TemperatureUnit
- All Implemented Interfaces:
Unit<Temperature>
- Version:
- 0.7, $Date: 2019-02-06 $
- Author:
- Werner Keil
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TemperatureUnit
Celsius, used by most of the world's population.static final TemperatureUnit
Fahrenheit, commonly used in the United States.static final TemperatureUnit
Kelvin, commonly used in scientific endeavors.static final TemperatureUnit
Rankine, used in scientific endeavors. -
Constructor Summary
ConstructorDescriptionTemperatureUnit
(double newMult, double shift, TemperatureUnit rel, double newFreezingPoint, double newBoilingPoint, String newSymbol, String newNamedFor) Constructor for TemperatureUnit that accepts key characteristics of each temperature scale. -
Method Summary
Modifier and TypeMethodDescriptionstatic TemperatureUnit
getBySymbol
(String symbol) double
getName()
boolean
isCompatible
(Unit<?> that) multiply
(double factor) Unit<?>
Unit<?>
pow
(int n) Unit<?>
root
(int n) shift
(double v) transform
(UnitConverter operation) Methods inherited from class TestUnit
alternate, divide, divide, divide, getBaseUnits, getConverterTo, getConverterToAny, getDimension, getMultFactor, getSystemConverter, inverse, isEquivalentTo, multiply, shift, toString
-
Field Details
-
KELVIN
Kelvin, commonly used in scientific endeavors. -
RANKINE
Rankine, used in scientific endeavors. -
CELSIUS
Celsius, used by most of the world's population. -
FAHRENHEIT
Fahrenheit, commonly used in the United States.
-
-
Constructor Details
-
TemperatureUnit
public TemperatureUnit(double newMult, double shift, TemperatureUnit rel, double newFreezingPoint, double newBoilingPoint, String newSymbol, String newNamedFor) Constructor for TemperatureUnit that accepts key characteristics of each temperature scale.- Parameters:
rel
- The temperature unit this is relative to.newFreezingPoint
- Freezing point for this temperature scale.newBoilingPoint
- Boiling point for this temperature scale.newSymbol
- Unit symbol for this temperature scale.newNamedFor
- Name of person after which temperature scale was named.newMult
- new multipliershift
- the shift factor
-
-
Method Details
-
getSymbol
- Specified by:
getSymbol
in interfaceUnit<Temperature>
- Overrides:
getSymbol
in classTestUnit<Temperature>
-
getFactor
-
getName
- Specified by:
getName
in interfaceUnit<Temperature>
- Overrides:
getName
in classTestUnit<Temperature>
-
getSystemUnit
- Specified by:
getSystemUnit
in interfaceUnit<Temperature>
- Specified by:
getSystemUnit
in classTestUnit<Temperature>
-
getBySymbol
-
isCompatible
- Specified by:
isCompatible
in interfaceUnit<Temperature>
- Overrides:
isCompatible
in classTestUnit<Temperature>
-
asType
- Specified by:
asType
in interfaceUnit<Temperature>
- Overrides:
asType
in classTestUnit<Temperature>
-
multiply
- Specified by:
multiply
in interfaceUnit<Temperature>
- Overrides:
multiply
in classTestUnit<Temperature>
-
multiply
- Specified by:
multiply
in interfaceUnit<Temperature>
- Overrides:
multiply
in classTestUnit<Temperature>
-
pow
- Specified by:
pow
in interfaceUnit<Temperature>
- Overrides:
pow
in classTestUnit<Temperature>
-
root
- Specified by:
root
in interfaceUnit<Temperature>
- Overrides:
root
in classTestUnit<Temperature>
-
transform
- Specified by:
transform
in interfaceUnit<Temperature>
- Overrides:
transform
in classTestUnit<Temperature>
-
shift
- Specified by:
shift
in interfaceUnit<Temperature>
- Overrides:
shift
in classTestUnit<Temperature>
-
getDescription
-
prefix
- Specified by:
prefix
in interfaceUnit<Temperature>
- Overrides:
prefix
in classTestUnit<Temperature>
-