View Javadoc
1   package org.opentrafficsim.core.unit;
2   
3   import static org.opentrafficsim.core.unit.unitsystem.UnitSystem.CGS_EMU;
4   import static org.opentrafficsim.core.unit.unitsystem.UnitSystem.CGS_ESU;
5   import static org.opentrafficsim.core.unit.unitsystem.UnitSystem.SI_BASE;
6   
7   import org.opentrafficsim.core.unit.unitsystem.UnitSystem;
8   
9   /**
10   * Standard units for electrical current.
11   * <p>
12   * Copyright (c) 2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
14   * <p>
15   * @version May 15, 2014 <br>
16   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
17   */
18  public class ElectricalCurrentUnit extends Unit<ElectricalCurrentUnit>
19  {
20      /** */
21      private static final long serialVersionUID = 20140607L;
22  
23      /** The SI unit for electrical current is Ampere. */
24      public static final ElectricalCurrentUnit SI;
25  
26      /** Ampere. */
27      public static final ElectricalCurrentUnit AMPERE;
28  
29      /** nanoampere. */
30      public static final ElectricalCurrentUnit NANOAMPERE;
31  
32      /** microampere. */
33      public static final ElectricalCurrentUnit MICROAMPERE;
34  
35      /** milliampere. */
36      public static final ElectricalCurrentUnit MILLIAMPERE;
37  
38      /** kiloampere. */
39      public static final ElectricalCurrentUnit KILOAMPERE;
40  
41      /** statampere (GCS ESU). */
42      public static final ElectricalCurrentUnit STATAMPERE;
43  
44      /** abampere (GCS EMU). */
45      public static final ElectricalCurrentUnit ABAMPERE;
46  
47      static
48      {
49          SI = new ElectricalCurrentUnit("ElectricalCurrentUnit.ampere", "ElectricalCurrentUnit.A", SI_BASE);
50          AMPERE = SI;
51          NANOAMPERE =
52                  new ElectricalCurrentUnit("ElectricalCurrentUnit.nanoampere", "ElectricalCurrentUnit.nA", SI_BASE,
53                          AMPERE, 1.0E-9);
54          MICROAMPERE =
55                  new ElectricalCurrentUnit("ElectricalCurrentUnit.microampere", "ElectricalCurrentUnit.muA", SI_BASE,
56                          AMPERE, 1.0E-6);
57          MILLIAMPERE =
58                  new ElectricalCurrentUnit("ElectricalCurrentUnit.milliampere", "ElectricalCurrentUnit.mA", SI_BASE,
59                          AMPERE, 0.001);
60          KILOAMPERE =
61                  new ElectricalCurrentUnit("ElectricalCurrentUnit.kiloampere", "ElectricalCurrentUnit.kA", SI_BASE,
62                          AMPERE, 1000.0);
63          STATAMPERE =
64                  new ElectricalCurrentUnit("ElectricalCurrentUnit.statampere", "ElectricalCurrentUnit.statA", CGS_ESU,
65                          AMPERE, 3.335641E-10);
66          ABAMPERE =
67                  new ElectricalCurrentUnit("ElectricalCurrentUnit.abampere", "ElectricalCurrentUnit.abA", CGS_EMU,
68                          AMPERE, 10.0);
69      }
70  
71      /**
72       * @param nameKey the key to the locale file for the long name of the unit
73       * @param abbreviationKey the key to the locale file for the abbreviation of the unit
74       * @param unitSystem the unit system, e.g. SI or Imperial
75       */
76      public ElectricalCurrentUnit(final String nameKey, final String abbreviationKey, final UnitSystem unitSystem)
77      {
78          super(nameKey, abbreviationKey, unitSystem, true);
79      }
80  
81      /**
82       * @param nameKey the key to the locale file for the long name of the unit
83       * @param abbreviationKey the key to the locale file for the abbreviation of the unit
84       * @param unitSystem the unit system, e.g. SI or Imperial
85       * @param referenceUnit the unit to convert to
86       * @param conversionFactorToReferenceUnit multiply a value in this unit by the factor to convert to the given
87       *            reference unit
88       */
89      public ElectricalCurrentUnit(final String nameKey, final String abbreviationKey, final UnitSystem unitSystem,
90              final ElectricalCurrentUnit referenceUnit, final double conversionFactorToReferenceUnit)
91      {
92          super(nameKey, abbreviationKey, unitSystem, referenceUnit, conversionFactorToReferenceUnit, true);
93      }
94  
95      /** {@inheritDoc} */
96      @Override
97      public final ElectricalCurrentUnit getStandardUnit()
98      {
99          return AMPERE;
100     }
101 
102     /** {@inheritDoc} */
103     @Override
104     public final String getSICoefficientsString()
105     {
106         return "A";
107     }
108 
109 }