Prefix.java

  1. /* Copyright 2002-2025 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.utils.units;

  18. /** Multiplicative prefixes.
  19.  * @author Luc Maisonobe
  20.  * @since 11.0
  21.  */
  22. enum Prefix {

  23.     /** Septillion. */
  24.     YOTTA("Y", 1.0e24),

  25.     /** Sextillion. */
  26.     ZETTA("Z", 1.0e21),

  27.     /** Quintillion. */
  28.     EXA("E", 1.0e18),

  29.     /** Quadrillion. */
  30.     PETA("P", 1.0e15),

  31.     /** Trillion. */
  32.     TERA("T", 1.0e12),

  33.     /** Billion. */
  34.     GIGA("G", 1.0e9),

  35.     /** Million. */
  36.     MEGA("M", 1.0e6),

  37.     /** Thousand. */
  38.     KILO("k", 1.0e3),

  39.     /** Hundred. */
  40.     HECTO("h", 1.0e2),

  41.     /** Ten. */
  42.     DECA("da", 1.0e1),

  43.     /** Tenth. */
  44.     DECI("d", 1.0e-1),

  45.     /** Hundredth. */
  46.     CENTI("c", 1.0e-2),

  47.     /** Thousandth. */
  48.     MILLI("m", 1.0e-3),

  49.     /** Millionth.
  50.      * <p>
  51.      * The symbol used here is the standard SI one: µ (U+00B5, MICRO SIGN)
  52.      * </p>
  53.      */
  54.     MICRO("µ", 1.0e-6),

  55.     /** Millionth.
  56.      * <p>
  57.      * The symbol used here is an alternate one: μ (U+03BC, GREEK SMALL LETTER MU)
  58.      * </p>
  59.      */
  60.     MICRO_ALTERNATE("μ", 1.0e-6),

  61.     /** Billionth. */
  62.     NANO("n", 1.0e-9),

  63.     /** Trillionth. */
  64.     PICO("p", 1.0e-12),

  65.     /** Quadrillionth. */
  66.     FEMTO("f", 1.0e-15),

  67.     /** Quintillionth. */
  68.     ATTO("a", 1.0e-18),

  69.     /** Sextillionth. */
  70.     ZEPTO("z", 1.0e-21),

  71.     /** Septillionth. */
  72.     YOCTO("y", 1.0e-24);

  73.     /** Symbol. */
  74.     private String symbol;

  75.     /** Multiplication factor. */
  76.     private double factor;

  77.     /** Simple constructor.
  78.      * @param symbol symbol
  79.      * @param factor multiplication factor
  80.      */
  81.     Prefix(final String symbol, final double factor) {
  82.         this.symbol = symbol;
  83.         this.factor = factor;
  84.     }

  85.     /** Get the prefix symbol.
  86.      * @return prefix symbol
  87.      */
  88.     public String getSymbol() {
  89.         return symbol;
  90.     }

  91.     /** Get the prefix multiplication factor.
  92.      * @return prefix multiplication factor
  93.      */
  94.     public double getFactor() {
  95.         return factor;
  96.     }

  97. }