asgaard.utils.unit
Class LinearScaling

java.lang.Object
  |
  +--asgaard.utils.unit.LinearScaling

public class LinearScaling
extends java.lang.Object
implements Convert

This Class carries the conversion of a measure from it's native form (in the base-unit exmpl iso "meter" for distance) to a customized unit (exmpl "mile")

See Also:
Serialized Form

Field Summary
protected  float multiplier
          For linear scaling
 
Constructor Summary
LinearScaling()
          Instanciates an converter with a neutral multiplier (1).
LinearScaling(float scale)
          Instanciates an converter
 
Method Summary
 float getBaseMeasure(float customMeasure)
          Returns the measure in the base-unit
 float getCustomMeasure(float baseMeasure)
          Returns the measure in the custom-unit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

multiplier

protected float multiplier
For linear scaling
Constructor Detail

LinearScaling

public LinearScaling()
Instanciates an converter with a neutral multiplier (1).

LinearScaling

public LinearScaling(float scale)
Instanciates an converter
Parameters:
scal - a liniar multiplier
Method Detail

getBaseMeasure

public float getBaseMeasure(float customMeasure)
Returns the measure in the base-unit
Specified by:
getBaseMeasure in interface Convert

getCustomMeasure

public float getCustomMeasure(float baseMeasure)
Returns the measure in the custom-unit
Specified by:
getCustomMeasure in interface Convert