org.apache.hadoop.hbase.types
Class OrderedFloat32

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

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class OrderedFloat32
extends OrderedBytesBase<Float>

A float of 32-bits using a fixed-length encoding. Based on OrderedBytes.encodeFloat32(PositionedByteRange, float, Order).


Field Summary
static OrderedFloat32 ASCENDING
           
static OrderedFloat32 DESCENDING
           
 
Fields inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
order
 
Constructor Summary
protected OrderedFloat32(Order order)
           
 
Method Summary
 Float decode(PositionedByteRange src)
          Read an instance of T from the buffer src.
 float decodeFloat(PositionedByteRange dst)
          Read a float value from the buffer dst.
 int encode(PositionedByteRange dst, Float val)
          Write instance val into buffer dst.
 Class<Float> encodedClass()
          Inform consumers over what type this DataType operates.
 int encodedLength(Float val)
          Inform consumers how long the encoded byte[] will be.
 int encodeFloat(PositionedByteRange dst, float val)
          Write instance val into buffer buff.
 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 OrderedFloat32 ASCENDING

DESCENDING

public static final OrderedFloat32 DESCENDING
Constructor Detail

OrderedFloat32

protected OrderedFloat32(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<Float>
Overrides:
isNullable in class OrderedBytesBase<Float>
Returns:
true when null is supported, false otherwise.

encodedLength

public int encodedLength(Float 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<Float> encodedClass()
Description copied from interface: DataType
Inform consumers over what type this DataType operates. Useful when working with bare DataType instances.


decode

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

decodeFloat

public float decodeFloat(PositionedByteRange dst)
Read a float value from the buffer dst.


encodeFloat

public int encodeFloat(PositionedByteRange dst,
                       float val)
Write instance val into buffer buff.



Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.