Interface XTCEAbsoluteTimeType
-
- All Known Implementing Classes:
XTCECcsdsCucTimeHandler,XTCEPosixTimeHandler
public interface XTCEAbsoluteTimeTypeThis interface permits the user/program to implement the handling of a specific form of an AbsoluteTimeType in the toolkit.An example of a class that implements this interface can be found in the toolkit as XTCEPosixTimeHandler. Another example is the class XTCECcsdsCucTimeHandler. These two types are automatically included, although user registed time handlers are always examined first, so they can be overridden.
This interface requires at least 5 implementation methods. These are described in the 5 public methods that follow.
At least one constructor will be required in the implementing classes because they get registered on the XTCEFunctions class for use throughout the toolkit as needed.
- Author:
- dovereem
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetCalibratedFromUncalibrated(String uncalValue)Retrieve the EU calibrated value of this time item, which can be a Parameter or Argument, when given the uncalibrated value.BitSetgetRawFromUncalibrated(String uncalValue)Retrieve the raw binary bits for encoding of this time item, which can be a Parameter or Argument, when given the uncalibrated value.StringgetUncalibratedFromCalibrated(String euValue)Retrieve the uncalibrated value for this time item, which can be a Parameter or Argument, when given the EU calibrated value.StringgetUncalibratedFromRaw(BitSet rawValue)Retrieve the uncalibrated value of this time item, which can be a Parameter or Argument, when given the raw binary value.booleanisApplicable(AbsoluteTimeDataType instance)Method to determine if an XTCE AbsoluteTimeType, either Parameter or Argument, is handled by this implementation of the interface.
-
-
-
Method Detail
-
isApplicable
boolean isApplicable(AbsoluteTimeDataType instance)
Method to determine if an XTCE AbsoluteTimeType, either Parameter or Argument, is handled by this implementation of the interface.The implementer should endeavor to have this function not throw an exception. If one is thrown, an error message will be logged by the encode/decode functions of the XTCEItemValue object where handlers that implement this class are used. A throw will short-circuit tests for other applicable handlers.
- Parameters:
instance- AbsoluteTimeDataType object from the JAXB representation of the XTCE XML document.- Returns:
- boolean indicating if this handler supports/implements handling for the user provided Absolute Time Type, as specified in the XML.
-
getUncalibratedFromRaw
String getUncalibratedFromRaw(BitSet rawValue)
Retrieve the uncalibrated value of this time item, which can be a Parameter or Argument, when given the raw binary value.The raw value is provided as a Java BitSet to account for an arbitrary size of the raw value binary. The output of this function takes into account the encoding type to interpret the raw binary in the proper type and alignment.
A common implementation for this function would be to return the microseconds since the UNIX epoch, although that is not specifically required.
This method should endeavor to not throw an exception, which is not hard because the input BitSet is a well constrained value.
- Parameters:
rawValue- BitSet containing the raw binary value that would be encoded on the wire or bitfield. The raw binary is always expected to be in the order read from the stream.- Returns:
- String containing the proper uncalibrated representation of the raw encoded value provided by the caller.
-
getCalibratedFromUncalibrated
String getCalibratedFromUncalibrated(String uncalValue)
Retrieve the EU calibrated value of this time item, which can be a Parameter or Argument, when given the uncalibrated value.A common implementation for this function would be to return the UTC or GPS ISO8601 string, although that is not specifically required.
This function may throw unchecked exceptions that inherit from java.lang.Exception. Exceptions will be caught by the XTCEItemValue class that uses this implementation. In the event that occurs, then the calling code will be provided with an error message regarding an invalid value for the specific parameter that was attempted.
- Parameters:
uncalValue- String containing the uncalibrated value that is derived from the encoded value on the wire or bitfield.- Returns:
- String containing the proper EU calibrated representation of the uncalibrated value provided by the caller.
-
getRawFromUncalibrated
BitSet getRawFromUncalibrated(String uncalValue)
Retrieve the raw binary bits for encoding of this time item, which can be a Parameter or Argument, when given the uncalibrated value.TIP: An implementer may be interested to use the BitSet conversion function in the static helper XTCEFunctions class.
This function may throw unchecked exceptions that inherit from java.lang.Exception. Exceptions will be caught by the XTCEItemValue class that uses this implementation. In the event that occurs, then the calling code will be provided with an error message regarding an invalid value for the specific parameter that was attempted.
- Parameters:
uncalValue- String containing the uncalibrated representation of the value.- Returns:
- BitSet containing the raw bits.
-
getUncalibratedFromCalibrated
String getUncalibratedFromCalibrated(String euValue)
Retrieve the uncalibrated value for this time item, which can be a Parameter or Argument, when given the EU calibrated value.This function may throw unchecked exceptions that inherit from java.lang.Exception. Exceptions will be caught by the XTCEItemValue class that uses this implementation. In the event that occurs, then the calling code will be provided with an error message regarding an invalid value for the specific parameter that was attempted.
- Parameters:
euValue- String containing a value of this item represented in EU/calibrated form.- Returns:
- String containing the uncalibrated value.
-
-