public class GenericUnitConverter extends AbstractUnitConverter
Can convert anyone unit to another by using a single scale factor and custom functions.
Modifier and Type | Field and Description |
---|---|
protected double |
conversionFactor |
protected boolean |
noFunctions |
conversionNeeded, conversionPossible, destUnit, srcUnit
Constructor and Description |
---|
GenericUnitConverter(double conversionFactor)
Default constructor using given scalefactor
|
GenericUnitConverter(Unit srcUnit,
Unit destUnit)
Default constructor using given units as source and destination
|
Modifier and Type | Method and Description |
---|---|
double |
convert(double value)
Converts a double value expressed in sourceUnit to
the corresponding value expressed in destinationUnit.
|
getDestUnit, getSrcUnit, isConversionNeeded, isConversionPossible, setDestUnit, setSrcUnit
protected double conversionFactor
protected boolean noFunctions
public GenericUnitConverter(double conversionFactor)
conversionFactor
- public double convert(double value)
AbstractUnitConverter
convert
in interface UnitConverter
convert
in class AbstractUnitConverter
Copyright © 2016 Sensia Software LLC. All rights reserved.