org.apache.hadoop.hbase.types
Class OrderedFloat64

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

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class OrderedFloat64
extends OrderedBytesBase<Double>

A double of 64-bits using a fixed-length encoding. Built on OrderedBytes.encodeFloat64(PositionedByteRange, double, Order).


Field Summary
static OrderedFloat64 ASCENDING
           
static OrderedFloat64 DESCENDING
           
 
Fields inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
order
 
Constructor Summary
protected OrderedFloat64(Order order)
           
 
Method Summary
 Double decode(PositionedByteRange src)
          Read an instance of T from the buffer src.
 double decodeDouble(PositionedByteRange src)
          Read a double value from the buffer src.
 int encode(PositionedByteRange dst, Double val)
          Write instance val into buffer dst.
 Class<Double> encodedClass()
          Inform consumers over what type this DataType operates.
 int encodedLength(Double val)
          Inform consumers how long the encoded byte[] will be.
 int encodeDouble(PositionedByteRange dst, double val)
          Write instance val into buffer dst.
 boolean isNullable()
          Indicates whether this instance supports encoding null values.
 
Methods inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
getOrder, isOrderPreserving, isSkippable, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASCENDING

public static final OrderedFloat64 ASCENDING

DESCENDING

public static final OrderedFloat64 DESCENDING
Constructor Detail

OrderedFloat64

protected OrderedFloat64(Order order)
Method Detail

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

public Class<Double> encodedClass()
Description copied from interface: DataType
Inform consumers over what type this DataType operates. Useful when working with bare DataType instances.


decode

public Double decode(PositionedByteRange src)
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.


encodeDouble

public int encodeDouble(PositionedByteRange dst,
                        double val)
Write instance val into buffer dst.



Copyright © 2013 The Apache Software Foundation. All Rights Reserved.