public class KlvIntegerEncodedFloatingPoint extends KlvNumericalDataElement<Double>
errorIndicatorValue
key, keyBytes, name, value
Constructor and Description |
---|
KlvIntegerEncodedFloatingPoint(KlvNumericalDataElement<?> klvRawDataValue,
long encodedRangeMin,
long encodedRangeMax,
double actualRangeMin,
double actualRangeMax)
Constructs a
KlvIntegerEncodedFloatingPoint representing a KLV element containing a
floating-point value that has been encoded as an integer value. |
KlvIntegerEncodedFloatingPoint(KlvNumericalDataElement<?> klvRawDataValue,
long encodedRangeMin,
long encodedRangeMax,
double actualRangeMin,
double actualRangeMax,
Optional<Double> errorIndicatorValue)
Constructs a
KlvIntegerEncodedFloatingPoint representing a KLV element containing a
floating-point value that has been encoded as an integer value. |
Modifier and Type | Method and Description |
---|---|
protected KlvIntegerEncodedFloatingPoint |
copy() |
protected void |
decodeValue(Klv klv) |
boolean |
isErrorIndicated()
If there is a floating point error indicator, then use it.
|
getKey, getKeyAsString, getName, getValue
public KlvIntegerEncodedFloatingPoint(KlvNumericalDataElement<?> klvRawDataValue, long encodedRangeMin, long encodedRangeMax, double actualRangeMin, double actualRangeMax)
KlvIntegerEncodedFloatingPoint
representing a KLV element containing a
floating-point value that has been encoded as an integer value.
The value returned by this KlvIntegerEncodedFloatingPoint
is calculated as follows:
klvRawDataValue
is converted to a long
encodedRangeMin
) / (encodedRangeMax
- encodedRangeMin
)
actualRangeMax
- actualRangeMin
) + actualRangeMin
klvRawDataValue
- the KlvNumericalDataElement
that retrieves the raw numerical
valueencodedRangeMin
- the minimum integer-encoded valueencodedRangeMax
- the maximum integer-encoded valueactualRangeMin
- the minimum decoded floating-point valueactualRangeMax
- the maximum decoded floating-point valuepublic KlvIntegerEncodedFloatingPoint(KlvNumericalDataElement<?> klvRawDataValue, long encodedRangeMin, long encodedRangeMax, double actualRangeMin, double actualRangeMax, Optional<Double> errorIndicatorValue)
KlvIntegerEncodedFloatingPoint
representing a KLV element containing a
floating-point value that has been encoded as an integer value.
The value returned by this KlvIntegerEncodedFloatingPoint
is calculated as follows:
klvRawDataValue
is converted to a long
encodedRangeMin
) / (encodedRangeMax
- encodedRangeMin
)
actualRangeMax
- actualRangeMin
) + actualRangeMin
klvRawDataValue
- the KlvNumericalDataElement
that retrieves the raw numerical
valueencodedRangeMin
- the minimum integer-encoded valueencodedRangeMax
- the maximum integer-encoded valueactualRangeMin
- the minimum decoded floating-point valueactualRangeMax
- the maximum decoded floating-point valueerrorIndicatorValue
- value that indicates an encoded errorprotected void decodeValue(Klv klv)
decodeValue
in class KlvNumericalDataElement<Double>
protected KlvIntegerEncodedFloatingPoint copy()
copy
in class KlvNumericalDataElement<Double>
public boolean isErrorIndicated()
isErrorIndicated
in class KlvNumericalDataElement<Double>
This work is licensed under a Creative Commons Attribution 4.0 International License.