Class KlvIntegerEncodedFloatingPoint


public class KlvIntegerEncodedFloatingPoint extends KlvNumericalDataElement<Double>
Represents a KLV element containing a floating-point value that has been encoded as an integer value.
  • Constructor Details

    • KlvIntegerEncodedFloatingPoint

      public 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.

      The value returned by this KlvIntegerEncodedFloatingPoint is calculated as follows:

    • The value returned by klvRawDataValue is converted to a long
    • Scale the value by calculating: (value - encodedRangeMin) / ( encodedRangeMax - encodedRangeMin)
    • Apply the scaled value to the actual range: scaled value * (actualRangeMax - actualRangeMin) + actualRangeMin
    • Parameters:
      klvRawDataValue - the KlvNumericalDataElement that retrieves the raw numerical value
      encodedRangeMin - the minimum integer-encoded value
      encodedRangeMax - the maximum integer-encoded value
      actualRangeMin - the minimum decoded floating-point value
      actualRangeMax - the maximum decoded floating-point value
    • KlvIntegerEncodedFloatingPoint

      public 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.

      The value returned by this KlvIntegerEncodedFloatingPoint is calculated as follows:

    • The value returned by klvRawDataValue is converted to a long
    • Scale the value by calculating: (value - encodedRangeMin) / ( encodedRangeMax - encodedRangeMin)
    • Apply the scaled value to the actual range: scaled value * (actualRangeMax - actualRangeMin) + actualRangeMin
    • Parameters:
      klvRawDataValue - the KlvNumericalDataElement that retrieves the raw numerical value
      encodedRangeMin - the minimum integer-encoded value
      encodedRangeMax - the maximum integer-encoded value
      actualRangeMin - the minimum decoded floating-point value
      actualRangeMax - the maximum decoded floating-point value
      errorIndicatorValue - value that indicates an encoded error
  • Method Details