1 package org.djunits.unit;
2
3 import org.djunits.quantity.Quantity;
4 import org.djunits.unit.scale.IdentityScale;
5 import org.djunits.unit.scale.LinearScale;
6 import org.djunits.unit.si.SIPrefixes;
7 import org.djunits.unit.unitsystem.UnitSystem;
8
9
10
11
12
13
14
15
16
17
18 public class MassUnit extends Unit<MassUnit>
19 {
20
21 private static final long serialVersionUID = 20140607L;
22
23
24 public static final Quantity<MassUnit> BASE = new Quantity<>("Mass", "kg");
25
26
27 public static final MassUnit SI =
28 new MassUnit().build(new Unit.Builder<MassUnit>().setQuantity(BASE).setId("kg").setName("kilogram")
29 .setUnitSystem(UnitSystem.SI_DERIVED).setSiPrefixes(SIPrefixes.KILO, 1.0).setScale(IdentityScale.SCALE));
30
31
32 public static final MassUnit KILOGRAM = SI;
33
34
35 public static final MassUnit GRAM = KILOGRAM.deriveLinear(1.0E-3, "g", "gram", UnitSystem.SI_BASE);
36
37
38 public static final MassUnit MICROGRAM = GRAM.deriveSI(SIPrefixes.getUnit("mu"), 1.0);
39
40
41 public static final MassUnit MILLIGRAM = GRAM.deriveSI(SIPrefixes.getUnit("m"), 1.0);
42
43
44 public static final MassUnit POUND = KILOGRAM.deriveLinear(0.45359237, "lb", "pound", UnitSystem.IMPERIAL);
45
46
47 public static final MassUnit OUNCE = POUND.deriveLinear(1.0 / 16.0, "oz", "ounce");
48
49
50 public static final MassUnit TON_LONG = POUND.deriveLinear(2240.0, "long tn", "long ton");
51
52
53 public static final MassUnit TON_SHORT = POUND.deriveLinear(2000.0, "sh tn", "short ton", UnitSystem.US_CUSTOMARY);
54
55
56 public static final MassUnit TON_METRIC = KILOGRAM.deriveLinear(1000.0, "t", "metric tonne", UnitSystem.SI_ACCEPTED);
57
58
59 public static final MassUnit TONNE = KILOGRAM.deriveLinear(1000.0, "t(mts)", "tonne", UnitSystem.MTS);
60
61
62 public static final MassUnit DALTON = KILOGRAM.deriveLinear(1.6605388628E-27, "Da", "Dalton", UnitSystem.SI_ACCEPTED);
63
64
65
66
67
68
69
70 public static final MassUnit MICROELECTRONVOLT = ELECTRONVOLT.deriveSI(SIPrefixes.getUnit("mu"), 1.0);
71
72
73 public static final MassUnit MILLIELECTRONVOLT = ELECTRONVOLT.deriveSI(SIPrefixes.getUnit("m"), 1.0);
74
75
76 public static final MassUnit KILOELECTRONVOLT = ELECTRONVOLT.deriveSI(SIPrefixes.getUnit("k"), 1.0);
77
78
79 public static final MassUnit MEGAELECTRONVOLT = ELECTRONVOLT.deriveSI(SIPrefixes.getUnit("M"), 1.0);
80
81
82 public static final MassUnit GIGAELECTRONVOLT = ELECTRONVOLT.deriveSI(SIPrefixes.getUnit("G"), 1.0);
83
84 }