Unit
Ampere
, Angstrom
, Bar
, Barye
, BohrRadius
, Calorie
, Candela
, Coulomb
, Count
, CubicCentimeter
, CubicMeter
, Dalton
, Debye
, Decimal
, Degree
, Dyne
, Electron
, ElectronVolt
, Erg
, Gram
, Hartree
, Hertz
, Joule
, Kelvin
, Liter
, Meter
, Mole
, Newton
, Pascal
, Percent
, Picosecond
, Pixel
, Poise
, Radian
, Second
, Statcoulomb
, Volt
, Watt
public class SimpleUnit extends java.lang.Object implements Unit
Constructor | Description |
---|---|
SimpleUnit(Dimension dimension,
double toSim,
java.lang.String name,
java.lang.String symbol,
boolean prefixAllowed) |
Modifier and Type | Method | Description |
---|---|---|
Dimension |
dimension() |
Returns the dimension of this base unit.
|
double |
fromSim(double x) |
Takes the given value in simulation units and converts it to class units.
|
boolean |
prefixAllowed() |
Some units (such as Angstroms) are not normally defined with a prefix
attached, and for such units this flag can be set to false to prohibit
the application of a prefix.
|
java.lang.String |
symbol() |
Returns the symbol of unit, such as "g" for grams.
|
double |
toSim(double x) |
Takes the given value in class units and converts it to simulation units.
|
java.lang.String |
toString() |
public SimpleUnit(Dimension dimension, double toSim, java.lang.String name, java.lang.String symbol, boolean prefixAllowed)
toSim
- conversion factor from this unit to simulation unitsname
- string describing this unitsymbol
- symbol for this unitprefixAllowed
- flag indicating if this unit is suitable for use with a prefix
(e.g., kilo, nano)public Dimension dimension()
public final double toSim(double x)
public final double fromSim(double x)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String symbol()
Unit
public boolean prefixAllowed()
prefixAllowed
in interface Unit