Class FloatingPoint

java.lang.Object
org.apache.derby.client.am.FloatingPoint

public class FloatingPoint extends Object
Converters from floating point bytes to Java float, double, or java.math.BigDecimal.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Supported Unix Big Endian IEEE 754 floating point representation.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static final int
    convertFromByteToInt(byte[] buffer, int offset)
    Convert the byte array to an int.
    private static final long
    convertFromByteToLong(byte[] buffer, int offset)
    Convert the byte array to a long.
    (package private) static double
    getDouble(byte[] buffer, int offset)
    Build a Java double from an 8-byte floating point representation.
    (package private) static float
    getFloat(byte[] buffer, int offset)
    Build a Java float from a 4-byte floating point representation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • IEEE_754_FLOATING_POINT

      public static final int IEEE_754_FLOATING_POINT
      Supported Unix Big Endian IEEE 754 floating point representation.
      See Also:
  • Constructor Details

    • FloatingPoint

      private FloatingPoint()
  • Method Details

    • convertFromByteToInt

      private static final int convertFromByteToInt(byte[] buffer, int offset)
      Convert the byte array to an int.
    • convertFromByteToLong

      private static final long convertFromByteToLong(byte[] buffer, int offset)
      Convert the byte array to a long.
    • getFloat

      static float getFloat(byte[] buffer, int offset)

      Build a Java float from a 4-byte floating point representation.

      This includes DERBY types:

      • REAL
      • FLOAT(1<=n<=24)
      Throws:
      IllegalArgumentException - if the specified representation is not recognized.
    • getDouble

      static double getDouble(byte[] buffer, int offset)
      Build a Java double from an 8-byte floating point representation.

      This includes DERBY types:

      • FLOAT
      • DOUBLE [PRECISION]
      Throws:
      IllegalArgumentException - if the specified representation is not recognized.