Package org.vast.unit
Class Unit
java.lang.Object
org.vast.unit.Unit
- All Implemented Interfaces:
Serializable
Unit object containing relationship to SI base units.
- Since:
- May 4, 2006
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected doubleprotected Stringprotected Stringprotected Stringprotected UnitFunctionprotected doubleprotected doubleprotected doubleprotected booleanprotected doubleprotected Stringprotected doubleprotected Stringprotected Stringprotected doubleprotected doubleprotected double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Copies this unit integrallydoubledoublegetCode()doubledoubledoublegetMeter()doublegetMole()getName()doublegetPi()doubledoubledoublebooleanisCompatible(Unit unit) Checks that this unit is physically compatible with the given unit, which also means that it is possible to convert from one to the other.booleanisEquivalent(Unit unit) booleanisMetric()voidmultiply(double scale) voidMultiply this unit by another unit to generate a complex unitvoidpower(double power) Raises this unit to the given power, thus modifying all powers of metric base SI coefs.setAmpere(double ampere) setCandela(double candela) setDescription(String description) setExpression(String expression) setFunction(UnitFunction function) setKelvin(double kelvin) setKilogram(double kilogram) setMeter(double meter) setMetric(boolean metric) setMole(double mole) setPi(double pi) setPrintSymbol(String symbol) setProperty(String property) setRadian(double radian) setScaleToSI(double scaleToSI) setSecond(double second) toString()
-
Field Details
-
name
-
code
-
printSymbol
-
property
-
description
-
expression
-
meter
protected double meter -
kilogram
protected double kilogram -
second
protected double second -
ampere
protected double ampere -
kelvin
protected double kelvin -
mole
protected double mole -
candela
protected double candela -
radian
protected double radian -
pi
protected double pi -
scaleToSI
protected double scaleToSI -
metric
protected boolean metric -
function
-
-
Constructor Details
-
Unit
public Unit()
-
-
Method Details
-
copy
Copies this unit integrally- Returns:
- a copy of this unit
-
isCompatible
Checks that this unit is physically compatible with the given unit, which also means that it is possible to convert from one to the other.- Parameters:
unit-- Returns:
- true if unit is compatible with this unit
-
isEquivalent
- Parameters:
unit-- Returns:
- true if this unit is equivalent to this unit
-
power
public void power(double power) Raises this unit to the given power, thus modifying all powers of metric base SI coefs.- Parameters:
power-
-
multiply
Multiply this unit by another unit to generate a complex unit- Parameters:
unit-
-
getCompatibleSIUnit
-
multiply
public void multiply(double scale) -
getName
-
setName
-
getCode
-
setCode
-
getPrintSymbol
- Returns:
- the print symbol of this Unit. If the print symbol is not set (i.e. null or empty), then the expression will be returned (if that is not null and not empty).
-
setPrintSymbol
-
getExpression
-
setExpression
-
getProperty
-
setProperty
-
getDescription
-
setDescription
-
isMetric
public boolean isMetric() -
setMetric
-
getAmpere
public double getAmpere() -
setAmpere
-
getCandela
public double getCandela() -
setCandela
-
getKelvin
public double getKelvin() -
setKelvin
-
getKilogram
public double getKilogram() -
setKilogram
-
getMeter
public double getMeter() -
setMeter
-
getMole
public double getMole() -
setMole
-
getPi
public double getPi() -
setPi
-
getRadian
public double getRadian() -
setRadian
-
getSecond
public double getSecond() -
setSecond
-
getScaleToSI
public double getScaleToSI() -
setScaleToSI
-
getFunction
-
setFunction
-
getUCUMExpression
-
toString
-