Class OrderedFloat64

java.lang.Object
org.apache.hadoop.hbase.types.OrderedBytesBase<Double>
org.apache.hadoop.hbase.types.OrderedFloat64
All Implemented Interfaces:
DataType<Double>

@Public public class OrderedFloat64 extends OrderedBytesBase<Double>
A double of 64-bits using a fixed-length encoding. Built on OrderedBytes.encodeFloat64(PositionedByteRange, double, Order).
  • Field Details

  • Constructor Details

    • OrderedFloat64

      public OrderedFloat64(Order order)
      Creates a new 64-bite double with a fixed-length encoding.
      Parameters:
      order - the Order to use
  • Method Details

    • isNullable

      public boolean isNullable()
      Description copied from interface: DataType
      Indicates whether this instance supports encoding null values. This depends on the implementation details of the encoding format. All DataTypes that support null should treat null as comparing less than any non-null value for default sort ordering purposes.
      Specified by:
      isNullable in interface DataType<Double>
      Overrides:
      isNullable in class OrderedBytesBase<Double>
      Returns:
      true when null is supported, false otherwise.
    • encodedLength

      public int encodedLength(Double val)
      Description copied from interface: DataType
      Inform consumers how long the encoded byte[] will be.
      Parameters:
      val - The value to check.
      Returns:
      the number of bytes required to encode val.a
    • encodedClass

      Description copied from interface: DataType
      Inform consumers over what type this DataType operates. Useful when working with bare DataType instances.
    • decode

      Description copied from interface: DataType
      Read an instance of T from the buffer src.
      Parameters:
      src - the buffer containing the encoded value.
    • encode

      public int encode(PositionedByteRange dst, Double val)
      Description copied from interface: DataType
      Write instance val into buffer dst.
      Parameters:
      dst - the buffer containing the encoded value.
      val - the value to encode onto dst.
      Returns:
      number of bytes written.
    • decodeDouble

      public double decodeDouble(PositionedByteRange src)
      Read a double value from the buffer src.
      Parameters:
      src - the PositionedByteRange to read the double from
      Returns:
      the double floating-point value with the same bit pattern
    • encodeDouble

      public int encodeDouble(PositionedByteRange dst, double val)
      Write instance val into buffer dst.
      Parameters:
      dst - the PositionedByteRange to write to
      val - the value to write to dst
      Returns:
      the number of bytes written