1 package org.djunits.unit;
2
3 import org.djunits.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 FrequencyUnit extends Unit<FrequencyUnit>
17 {
18
19 private static final long serialVersionUID = 20140607L;
20
21
22 public static final Quantity<FrequencyUnit> BASE = new Quantity<>("Frequency", "/s");
23
24
25 public static final FrequencyUnit SI =
26 new FrequencyUnit().build(new Unit.Builder<FrequencyUnit>().setQuantity(BASE).setId("Hz").setName("hertz")
27 .setUnitSystem(UnitSystem.SI_DERIVED).setSiPrefixes(SIPrefixes.UNIT, 1.0).setScale(IdentityScale.SCALE));
28
29
30 public static final FrequencyUnit HERTZ = SI;
31
32
33 public static final FrequencyUnit KILOHERTZ = HERTZ.deriveSI(SIPrefixes.getUnit("k"), 1.0);
34
35
36 public static final FrequencyUnit MEGAHERTZ = HERTZ.deriveSI(SIPrefixes.getUnit("M"), 1.0);
37
38
39 public static final FrequencyUnit GIGAHERTZ = HERTZ.deriveSI(SIPrefixes.getUnit("G"), 1.0);
40
41
42 public static final FrequencyUnit TERAHERTZ = HERTZ.deriveSI(SIPrefixes.getUnit("T"), 1.0);
43
44
45 public static final FrequencyUnit RPM = HERTZ.deriveLinear(1.0 / 60.0, "rpm", "revolutions per minute", UnitSystem.OTHER);
46
47
48 public static final FrequencyUnit PER_SECOND = new FrequencyUnit().build(new Unit.Builder<FrequencyUnit>().setQuantity(BASE)
49 .setId("/s").setName("per second").setUnitSystem(UnitSystem.SI_DERIVED).setSiPrefixes(SIPrefixes.PER_UNIT, 1.0)
50 .setScale(IdentityScale.SCALE).setAdditionalAbbreviations("/s", "1/s", "/sec", "1/sec"));
51
52
53 public static final FrequencyUnit PER_MICROSECOND = PER_SECOND.deriveLinear(1.0E6, "/mus", "per microsecond",
54 UnitSystem.SI_DERIVED, "/\u03BCs", "/mus", "1/mus", "1/\u03BCs", "/musec", "1/musec", "/\u03BCsec", "1/\u03BCsec");
55
56
57 public static final FrequencyUnit PER_MILLISECOND = PER_SECOND.deriveLinear(1.0E3, "/ms", "per millisecond",
58 UnitSystem.SI_DERIVED, "/ms", "/ms", "1/ms", "/msec", "1/msec");
59
60
61 public static final FrequencyUnit PER_MINUTE =
62 PER_SECOND.deriveLinear(1.0 / 60.0, "/min", "per minute", UnitSystem.SI_ACCEPTED, "/min", "1/min");
63
64
65 public static final FrequencyUnit PER_HOUR = PER_SECOND.deriveLinear(1.0 / 3600.0, "/h", "per hour", UnitSystem.SI_ACCEPTED,
66 "/h", "/h", "1/h", "/hr", "1/hr", "/hour", "1/hour");
67
68
69 public static final FrequencyUnit PER_DAY =
70 PER_HOUR.deriveLinear(1.0 / 24.0, "/day", "per day", UnitSystem.SI_ACCEPTED, "/day", "/day", "1/day");
71
72
73 public static final FrequencyUnit PER_WEEK =
74 PER_DAY.deriveLinear(1.0 / 7.0, "/wk", "per week", UnitSystem.OTHER, "/wk", "/wk", "1/wk", "/week", "1/week");
75
76 }