Package org.xtce.math
Class MathOperationCalibration
- java.lang.Object
-
- org.xtce.math.MathOperationCalibration
-
- All Implemented Interfaces:
Calibration
public class MathOperationCalibration extends Object implements Calibration
Class to apply a calibration specified in an XTCE document in the form of a Math Operation Calibrator.- Author:
- David Overeem
-
-
Constructor Summary
Constructors Constructor Description MathOperationCalibration(CalibratorType.MathOperationCalibrator element)Constructs a Calibration object based on the MathOperationCalibrator element in the XTCE document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Numbercalibrate(Number xValue)Calibration of values using MathOperationCalibrator has some limited support for common numeric values and operators.StringtoInfixString()Method to create a simple space delimited string that represents the infix expression from the XTCE MathOperationCalibrator that this object instance represents.StringtoString()Method to create a simple space delimited string that represents the postfix expression from the XTCE MathOperationCalibrator that this object instance represents.Numberuncalibrate(Number yValue)Reverse calibration of values is not yet supported for MathOperationCalibrator.
-
-
-
Constructor Detail
-
MathOperationCalibration
public MathOperationCalibration(CalibratorType.MathOperationCalibrator element)
Constructs a Calibration object based on the MathOperationCalibrator element in the XTCE document.- Parameters:
element- MathOperationCalibrator containing the data.
-
-
Method Detail
-
calibrate
public Number calibrate(Number xValue) throws XTCEDatabaseException
Calibration of values using MathOperationCalibrator has some limited support for common numeric values and operators. Some operators are not yet implemented, but likely will be supported in the future. The following list contains the unsupported operators that are specified in XTCE 1.1:- case "&": // really for integer values only?
- case "|": // really for integer values only?
- case "<<": // really for integer values only?
- case ">>": // really for integer values only?
- case ">>>": // really for integer values only?
- case "x!": // not in the basic java.lang.Math
- case "atanh": // not in the basic java.lang.Math
- case "asinh": // not in the basic java.lang.Math
- case "acosh": // not in the basic java.lang.Math
- Specified by:
calibratein interfaceCalibration- Parameters:
xValue- Number containing the uncalibrated value.- Returns:
- Number containing the calibrated value after the calibration.
- Throws:
XTCEDatabaseException- thrown in the event that the math operator is not yet supported, the stack is exhausted, which would occur for an invalid expression, or for an arithmetic error, such as a division by zero.
-
uncalibrate
public Number uncalibrate(Number yValue) throws XTCEDatabaseException
Reverse calibration of values is not yet supported for MathOperationCalibrator.- Specified by:
uncalibratein interfaceCalibration- Parameters:
yValue- Number containing the calibrated value.- Returns:
- Number containing the uncalibrated value after the reverse calibration operation.
- Throws:
XTCEDatabaseException- any time this is called.
-
toString
public String toString()
Method to create a simple space delimited string that represents the postfix expression from the XTCE MathOperationCalibrator that this object instance represents.
-
toInfixString
public String toInfixString() throws XTCEDatabaseException
Method to create a simple space delimited string that represents the infix expression from the XTCE MathOperationCalibrator that this object instance represents.- Returns:
- String containing a space delimited expression of operands and operators in infix notation.
- Throws:
XTCEDatabaseException- thrown in the event that the math operator is not yet supported or the stack is exhausted, which would occur for an invalid expression.
-
-