public enum MetricPrefix extends java.lang.Enum<MetricPrefix> implements Prefix
This class provides support for the 20 prefixes used in the metric system (decimal multiples and submultiples of units). For example:
import static tech.units.indriya.unit.Units.*; // Static import.
import static javax.measure.MetricPrefix.*; // Static import.
import javax.measure.*;
import javax.measure.quantity.*;
...
Unit HECTOPASCAL = HECTO(PASCAL);
Unit KILOMETRE = KILO(METRE);
Enum Constant and Description |
---|
ATTO |
CENTI |
DECI |
DEKA |
EXA |
FEMTO |
GIGA |
HECTO |
KILO |
MEGA |
MICRO |
MILLI |
NANO |
PETA |
PICO |
TERA |
YOCTO |
YOTTA |
ZEPTO |
ZETTA |
Modifier and Type | Method and Description |
---|---|
static <Q extends Quantity<Q>> |
ATTO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-18 |
static <Q extends Quantity<Q>> |
CENTI(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-2 |
static <Q extends Quantity<Q>> |
DECI(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-1 |
static <Q extends Quantity<Q>> |
DEKA(Unit<Q> unit)
Returns the specified unit multiplied by the factor
101 |
static <Q extends Quantity<Q>> |
EXA(Unit<Q> unit)
Returns the specified unit multiplied by the factor
1018 |
static <Q extends Quantity<Q>> |
FEMTO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-15 |
int |
getBase()
Base part of the associated factor in base^exponent representation.
|
int |
getExponent()
Exponent part of the associated factor in base^exponent representation.
|
java.lang.String |
getName()
Returns the name of this prefix.
|
java.lang.String |
getSymbol()
Returns the symbol of this prefix.
|
static <Q extends Quantity<Q>> |
GIGA(Unit<Q> unit)
Returns the specified unit multiplied by the factor
109 |
static <Q extends Quantity<Q>> |
HECTO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
102 |
static <Q extends Quantity<Q>> |
KILO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
103 |
static <Q extends Quantity<Q>> |
MEGA(Unit<Q> unit)
Returns the specified unit multiplied by the factor
106 |
static <Q extends Quantity<Q>> |
MICRO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-6 |
static <Q extends Quantity<Q>> |
MILLI(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-3 |
static <Q extends Quantity<Q>> |
NANO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-9 |
static <Q extends Quantity<Q>> |
PETA(Unit<Q> unit)
Returns the specified unit multiplied by the factor
1015 |
static <Q extends Quantity<Q>> |
PICO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-12 |
static <Q extends Quantity<Q>> |
TERA(Unit<Q> unit)
Returns the specified unit multiplied by the factor
1012 |
static MetricPrefix |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static MetricPrefix[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static <Q extends Quantity<Q>> |
YOCTO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-24 |
static <Q extends Quantity<Q>> |
YOTTA(Unit<Q> unit)
Returns the specified unit multiplied by the factor
1024 |
static <Q extends Quantity<Q>> |
ZEPTO(Unit<Q> unit)
Returns the specified unit multiplied by the factor
10-21 |
static <Q extends Quantity<Q>> |
ZETTA(Unit<Q> unit)
Returns the specified unit multiplied by the factor
1021 |
public static final MetricPrefix YOTTA
public static final MetricPrefix ZETTA
public static final MetricPrefix EXA
public static final MetricPrefix PETA
public static final MetricPrefix TERA
public static final MetricPrefix GIGA
public static final MetricPrefix MEGA
public static final MetricPrefix KILO
public static final MetricPrefix HECTO
public static final MetricPrefix DEKA
public static final MetricPrefix DECI
public static final MetricPrefix CENTI
public static final MetricPrefix MILLI
public static final MetricPrefix MICRO
public static final MetricPrefix NANO
public static final MetricPrefix PICO
public static final MetricPrefix FEMTO
public static final MetricPrefix ATTO
public static final MetricPrefix ZEPTO
public static final MetricPrefix YOCTO
public static MetricPrefix[] values()
for (MetricPrefix c : MetricPrefix.values()) System.out.println(c);
public static MetricPrefix valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static <Q extends Quantity<Q>> Unit<Q> YOTTA(Unit<Q> unit)
1024
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e24)
.public static <Q extends Quantity<Q>> Unit<Q> ZETTA(Unit<Q> unit)
1021
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e21)
.public static <Q extends Quantity<Q>> Unit<Q> EXA(Unit<Q> unit)
1018
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e18)
.public static <Q extends Quantity<Q>> Unit<Q> PETA(Unit<Q> unit)
1015
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e15)
.public static <Q extends Quantity<Q>> Unit<Q> TERA(Unit<Q> unit)
1012
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e12)
.public static <Q extends Quantity<Q>> Unit<Q> GIGA(Unit<Q> unit)
109
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e9)
.public static <Q extends Quantity<Q>> Unit<Q> MEGA(Unit<Q> unit)
106
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e6)
.public static <Q extends Quantity<Q>> Unit<Q> KILO(Unit<Q> unit)
103
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e3)
.public static <Q extends Quantity<Q>> Unit<Q> HECTO(Unit<Q> unit)
102
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e2)
.public static <Q extends Quantity<Q>> Unit<Q> DEKA(Unit<Q> unit)
101
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e1)
.public static <Q extends Quantity<Q>> Unit<Q> DECI(Unit<Q> unit)
10-1
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-1)
.public static <Q extends Quantity<Q>> Unit<Q> CENTI(Unit<Q> unit)
10-2
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-2)
.public static <Q extends Quantity<Q>> Unit<Q> MILLI(Unit<Q> unit)
10-3
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-3)
.public static <Q extends Quantity<Q>> Unit<Q> MICRO(Unit<Q> unit)
10-6
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-6)
.public static <Q extends Quantity<Q>> Unit<Q> NANO(Unit<Q> unit)
10-9
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-9)
.public static <Q extends Quantity<Q>> Unit<Q> PICO(Unit<Q> unit)
10-12
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-12)
.public static <Q extends Quantity<Q>> Unit<Q> FEMTO(Unit<Q> unit)
10-15
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-15)
.public static <Q extends Quantity<Q>> Unit<Q> ATTO(Unit<Q> unit)
10-18
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-18)
.public static <Q extends Quantity<Q>> Unit<Q> ZEPTO(Unit<Q> unit)
10-21
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-21)
.public static <Q extends Quantity<Q>> Unit<Q> YOCTO(Unit<Q> unit)
10-24
Q
- The type of the quantity measured by the unit.unit
- any unit.unit.times(1e-24)
.public java.lang.String getSymbol()
public int getBase()
public int getExponent()
getExponent
in interface Prefix
Copyright © 2014–2018 Jean-Marie Dautelle, Werner Keil, Otavio Santana. All rights reserved.