org.openl.types.science
Class ASimpleUnit
java.lang.Object
org.openl.types.science.AMultiplicativeExpression
org.openl.types.science.ASimpleUnit
- All Implemented Interfaces:
- INamedThing, IDimensionPower, IMultiplicativeExpression, IUnit
- Direct Known Subclasses:
- ZeroBasedUnit
public abstract class ASimpleUnit
- extends AMultiplicativeExpression
- implements IUnit, IDimensionPower, INamedThing
- Author:
- snshor
|
Constructor Summary |
protected |
ASimpleUnit(String name,
IDimension dimension)
Converts value measured in this unit into value "normal" in this
dimension. |
| Methods inherited from class org.openl.types.science.AMultiplicativeExpression |
add, divide, isAdditiveCompatible, multiply, negate, print, printAs, printAs, printInSystem, subtract, toString |
ASimpleUnit
protected ASimpleUnit(String name,
IDimension dimension)
- Converts value measured in this unit into value "normal" in this
dimension. Based on convention certainly, so in metric system normal
values are meter, second and kilogramm. Based on this unit of length cm
will have to have normalized function 0.01 * value.
- Parameters:
value -
getDimension
public IDimension getDimension()
- Specified by:
getDimension in interface IDimensionPower
getDimensionCount
public int getDimensionCount()
- Description copied from interface:
IMultiplicativeExpression
- Returns number of different dimensions it has
- Specified by:
getDimensionCount in interface IMultiplicativeExpression
- Returns:
getDimensionPower
public IDimensionPower getDimensionPower(IDimension id)
- Specified by:
getDimensionPower in interface IMultiplicativeExpression
getDimensionsPowers
public Iterator getDimensionsPowers()
- Specified by:
getDimensionsPowers in interface IMultiplicativeExpression
getDisplayName
public String getDisplayName(int mode)
- Specified by:
getDisplayName in interface INamedThing
getName
public String getName()
- Specified by:
getName in interface INamedThing- Specified by:
getName in interface IUnit
- Returns:
getPower
public int getPower()
- Specified by:
getPower in interface IDimensionPower
getScalar
public double getScalar()
- Description copied from interface:
IMultiplicativeExpression
- Return scalar part of the expression
- Specified by:
getScalar in interface IMultiplicativeExpression
- Returns:
normalize
public abstract double normalize(double value)
Copyright © 2011. All Rights Reserved.