org.openl.types.science
Class ASimpleUnit

java.lang.Object
  extended by org.openl.types.science.AMultiplicativeExpression
      extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.openl.base.INamedThing
INamedThing.NameConverter<T extends INamedThing>, INamedThing.NameSelector, INamedThing.Tool
 
Field Summary
 
Fields inherited from interface org.openl.base.INamedThing
EMPTY, LONG, NAME_CONVERTOR, REGULAR, SHORT
 
Constructor Summary
protected ASimpleUnit(String name, IDimension dimension)
          Converts value measured in this unit into value "normal" in this dimension.
 
Method Summary
 IDimension getDimension()
           
 int getDimensionCount()
          Returns number of different dimensions it has
 IDimensionPower getDimensionPower(IDimension id)
           
 Iterator getDimensionsPowers()
           
 String getDisplayName(int mode)
           
 String getName()
           
 int getPower()
           
 double getScalar()
          Return scalar part of the expression
abstract  double normalize(double value)
           
 
Methods inherited from class org.openl.types.science.AMultiplicativeExpression
add, divide, isAdditiveCompatible, multiply, negate, print, printAs, printAs, printInSystem, subtract, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openl.types.science.IMultiplicativeExpression
add, changeScalar, divide, multiply, negate, printAs, printAs, printInSystem, subtract
 

Constructor Detail

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 -
Method Detail

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 © 2013. All Rights Reserved.