public class ConversionFormat
extends java.lang.Object
Constructor and Description |
---|
ConversionFormat(org.w3c.dom.Node formatNode)
Constructor for the ConversionFormat object.
|
Modifier and Type | Method and Description |
---|---|
double |
convert(java.lang.String masterValue,
java.lang.String slaveValue,
double arg1,
double arg2,
boolean direct,
int decimalsNumber)
Based on masterValue and slaveValue it determines the conversion entry
that knows how to convert the two values.
|
java.lang.String |
getAssociatedLabel(java.lang.String measure)
Get the label associated with a measure.
|
java.util.Set |
getMasterValues(java.lang.String slaveValue)
Get all the possible values that can be listed in the first combo box,
in the context of the selected value in the second combo box.
|
java.lang.String |
getName()
Get the format name.
|
java.util.Set |
getSlaveValues(java.lang.String masterValue)
Get all the possible values that can be listed in the second combo box,
in the context of the selected value in the first combo box.
|
public ConversionFormat(org.w3c.dom.Node formatNode) throws ConversionException
formatNode
- The root node for this format.ConversionException
- If an entry for this format is invalid,
or root node is null.public java.lang.String getName()
public java.util.Set getMasterValues(java.lang.String slaveValue)
slaveValue
- The value that is selected in the second combo box. If
null, all the possible values for the first combo box will be
returned.public java.util.Set getSlaveValues(java.lang.String masterValue)
masterValue
- The value that is selected in the first combo box. If
null, all the possible values for the second combo box will be
returned.public java.lang.String getAssociatedLabel(java.lang.String measure)
measure
- The measure, for example "milimeters"public double convert(java.lang.String masterValue, java.lang.String slaveValue, double arg1, double arg2, boolean direct, int decimalsNumber) throws ConversionException
masterValue
- The first section conversion measure. Eg
"foot".slaveValue
- The second section conversion measure. Eg
"meter".arg1
- The value existing in the first edit.arg2
- The value existing in the first edit.direct
- Is true when the conversion is made
directly from the first measure into the second, or reversed.decimalsNumber
- The decimals number.ConversionException
- Description of Exception© Copyright Syncro Soft SRL 2002 - 2014. All rights reserved.