All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----pmr.molecule.Unit
to get to SI: siVal = (val - addToSI) * multiplyToSI;
to get from SI: val = siVal / multiplyToSI + addToSI;
This constructor should be used for NON SI units
public Unit(String nam, String typ, UnitDimension d) throws DuplicateUnitException
public Unit(String nam, String typ, UnitDimension d, double mult, double add) throws DuplicateUnitException
to get to SI: siVal = (val - addToSI) * multiplyToSI;
to get from SI: val = siVal / multiplyToSI + addToSI;
This constructor should be used for NON SI units
public void addSynonym(String s) throws DuplicateUnitException
public static Unit[] getUnits()
public static Unit getUnit(String name)
publicString getName()
publicString getType()
public UnitDimension getUnitDimension()
public static StringList getNames(String type)
public static Unit getSIUnit(String type)
publicString toString()
public double convertToSI(double val)
public double convertFromSI(double val)
public double convertFromOtherUnit(double val,
Unit otherUnit) throws IncompatibleUnitException
public static double convertFromTo(double val,
String fromUnit,
String toUnit) throws IncompatibleUnitException
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index