ro.sync.sample.plugin.converter
Class FactorConversionEntry
java.lang.Object
ro.sync.sample.plugin.converter.ConversionEntry
ro.sync.sample.plugin.converter.FactorConversionEntry
public class FactorConversionEntry
- extends ConversionEntry
Implements a factor based conversion.
- Version:
- $Revision: 1.13 $
Constructor Summary |
FactorConversionEntry(java.lang.String masterLabel,
java.lang.String slaveLabel,
java.lang.String masterValue,
java.lang.String slaveValue,
int decimalsToShow,
double factor)
Constructor for the FactorConversionEntry object. |
Method Summary |
double |
convert(double what,
boolean direct,
int decimalsNumber)
Converts the argument from the master measure to the slave measure if
direct attribute is true, otherwise reverse. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FactorConversionEntry
public FactorConversionEntry(java.lang.String masterLabel,
java.lang.String slaveLabel,
java.lang.String masterValue,
java.lang.String slaveValue,
int decimalsToShow,
double factor)
throws ConversionException
- Constructor for the FactorConversionEntry object.
- Parameters:
masterLabel
- The master measure label.slaveLabel
- The slave measure label.masterValue
- The master measure value.slaveValue
- The second section value.decimalsToShow
- The decimals number to be included in the
result.factor
- The conversion factor.
- Throws:
ConversionException
- Trown when this conversion entry is
invalid, that means one of the argument is null, or conversion
factor is 0.
convert
public double convert(double what,
boolean direct,
int decimalsNumber)
- Converts the argument from the master measure to the slave measure if
direct attribute is true, otherwise reverse.
- Specified by:
convert
in class ConversionEntry
- Parameters:
what
- The conversion argument.direct
- If true, then make the conversion from s1 to s2,
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.