1 package org.djunits.unit;
2
3 import org.djunits.unit.quantity.Quantity;
4 import org.djunits.unit.scale.IdentityScale;
5 import org.djunits.unit.si.SIPrefixes;
6 import org.djunits.unit.unitsystem.UnitSystem;
7
8
9
10
11
12
13
14
15
16 public class TemperatureUnit extends Unit<TemperatureUnit>
17 {
18
19 private static final long serialVersionUID = 20140605L;
20
21
22 public static final Quantity<TemperatureUnit> BASE = new Quantity<>("Temperature", "K");
23
24
25 public static final TemperatureUnit SI =
26 new TemperatureUnit().build(new Unit.Builder<TemperatureUnit>().setQuantity(BASE).setId("K").setName("Kelvin")
27 .setUnitSystem(UnitSystem.SI_BASE).setSiPrefixes(SIPrefixes.UNIT, 1.0).setScale(IdentityScale.SCALE));
28
29
30 public static final TemperatureUnit KELVIN = SI;
31
32
33 public static final TemperatureUnit DEGREE_CELSIUS =
34 KELVIN.deriveLinear(1.0, "dgC", "degree Celcius", UnitSystem.SI_DERIVED, "\u00B0C", "degC", new String[] {"C"});
35
36
37 public static final TemperatureUnit DEGREE_FAHRENHEIT = KELVIN.deriveLinear(5.0 / 9.0, "dgF", "degree Fahrenheit",
38 UnitSystem.SI_DERIVED, "\u00B0F", "degF", new String[] {"F"});
39
40
41 public static final TemperatureUnit DEGREE_RANKINE = KELVIN.deriveLinear(5.0 / 9.0, "dgR", "degree Rankine",
42 UnitSystem.SI_DERIVED, "\u00B0R", "degR", new String[] {"R"});
43
44
45 public static final TemperatureUnit DEGREE_REAUMUR = KELVIN.deriveLinear(4.0 / 5.0, "dgRe", "degree Reaumur",
46 UnitSystem.SI_DERIVED, "\u00B0R\u00E9", "degRe", new String[] {"Re", "R\u00E9"});
47
48 }