ro.sync.sample.plugin.converter
Class FormulaConversionEntry
java.lang.Object
ro.sync.sample.plugin.converter.ConversionEntry
ro.sync.sample.plugin.converter.FormulaConversionEntry
public class FormulaConversionEntry
- extends ConversionEntry
Implements a formula based convertor. The formula is rez = (arg -v1)/v2. The
reverse of the formula is: rez = arg * v2 + v1.
- Version:
- $Revision: 1.13 $
Constructor Summary |
FormulaConversionEntry(java.lang.String masterLabel,
java.lang.String slaveLabel,
java.lang.String masterValue,
java.lang.String slaveValue,
int decimals,
double v1,
double v2)
Constructor for the FormulaConversionEntry object |
Method Summary |
double |
convert(double what,
boolean direct,
int decimalsNumber)
Converts the argument from the master measure to the slave measure. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FormulaConversionEntry
public FormulaConversionEntry(java.lang.String masterLabel,
java.lang.String slaveLabel,
java.lang.String masterValue,
java.lang.String slaveValue,
int decimals,
double v1,
double v2)
throws ConversionException
- Constructor for the FormulaConversionEntry object
- Parameters:
masterLabel
- The master measure label.slaveLabel
- The slave measure label.masterValue
- The master measure value.slaveValue
- The second section value.v1
- The v1 constantv2
- The v2 constantdecimals
- The decimals number to be included in the
result.
- Throws:
ConversionException
- Trown when this conversion entry is
invalid, that means one of the argument is null, or v2 value is 0.
convert
public double convert(double what,
boolean direct,
int decimalsNumber)
- Converts the argument from the master measure to the slave measure.
- Specified by:
convert
in class ConversionEntry
- Parameters:
what
- The conversion argumentdirect
- If true, then make the conversion from master to
slave, otherwise reverse.decimalsNumber
- The decimals number witch be included in the
result.
- Returns:
- The conversion result.
© Copyright Syncro Soft SRL 2002 - 2013. All rights reserved.