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