1 package org.djunits.unit.unitsystem;
2
3 import java.io.Serializable;
4
5 import org.djunits.locale.UnitLocale;
6
7
8
9
10
11
12
13
14
15 public abstract class UnitSystem implements Serializable
16 {
17
18 private static final long serialVersionUID = 20140606L;
19
20
21 public static final CGS CGS;
22
23
24 public static final CGS_ESU CGS_ESU;
25
26
27 public static final CGS_EMU CGS_EMU;
28
29
30 public static final Imperial IMPERIAL;
31
32
33 public static final MTS MTS;
34
35
36 public static final Other OTHER;
37
38
39 public static final SIAccepted SI_ACCEPTED;
40
41
42 public static final SIBase SI_BASE;
43
44
45 public static final SIDerived SI_DERIVED;
46
47
48 public static final USCustomary US_CUSTOMARY;
49
50
51 public static final AU AU;
52
53 static
54 {
55 CGS = new CGS("UnitSystem.CGS", "UnitSystem.centimeter-gram-second_system");
56 CGS_ESU = new CGS_ESU("UnitSystem.CGS_(ESU)", "UnitSystem.centimeter-gram-second_system,_electrostatic_units");
57 CGS_EMU = new CGS_EMU("UnitSystem.CGS_(EMU)", "UnitSystem.centimeter-gram-second_system,_electromagnetic_units");
58 IMPERIAL = new Imperial("UnitSystem.Imperial", "UnitSystem.Imperial_system");
59 MTS = new MTS("UnitSystem.MTS", "UnitSystem.meter-tonne-second_system");
60 OTHER = new Other("UnitSystem.Other", "UnitSystem.other_system");
61 SI_ACCEPTED = new SIAccepted("UnitSystem.SI_accepted", "UnitSystem.International_System_of_Units_(Accepted_Unit)");
62 SI_BASE = new SIBase("UnitSystem.SI", "UnitSystem.International_System_of_Units_(Base_Unit)");
63 SI_DERIVED = new SIDerived("UnitSystem.SI_derived", "UnitSystem.International_System_of_Units_(Derived_Unit)");
64 US_CUSTOMARY = new USCustomary("UnitSystem.US_customary", "UnitSystem.US_customary_system");
65 AU = new AU("UnitSystem.AU", "UnitSystem.Atomic_Unit_system");
66 }
67
68
69 private final String abbreviationKey;
70
71
72 private final String nameKey;
73
74
75 private static UnitLocale localization = new UnitLocale("unitsystem");
76
77
78
79
80
81
82 protected UnitSystem(final String abbreviationKey, final String nameKey)
83 {
84 this.abbreviationKey = abbreviationKey;
85 this.nameKey = nameKey;
86 }
87
88
89
90
91
92 public final String getName()
93 {
94 return localization.getString(this.nameKey);
95 }
96
97
98
99
100
101 public final String getNameKey()
102 {
103 return this.nameKey;
104 }
105
106
107
108
109
110 public final String getAbbreviation()
111 {
112 return localization.getString(this.abbreviationKey);
113 }
114
115
116
117
118
119 public final String getAbbreviationKey()
120 {
121 return this.abbreviationKey;
122 }
123
124 @Override
125 public String toString()
126 {
127 return "UnitSystem [abbreviationKey=" + this.abbreviationKey + ", nameKey=" + this.nameKey + "]";
128 }
129
130 }