This project has retired. For details please refer to its Attic page.
SignedBinaryEncoder (Apache Gora 0.2 API)

org.apache.gora.accumulo.encoders
Class SignedBinaryEncoder

java.lang.Object
  extended by org.apache.gora.accumulo.encoders.BinaryEncoder
      extended by org.apache.gora.accumulo.encoders.SignedBinaryEncoder
All Implemented Interfaces:
Encoder

public class SignedBinaryEncoder
extends BinaryEncoder

This class transforms this bits within a primitive type so that the bit representation sorts correctly lexographicaly. Primarily it does some simple transformations so that negative numbers sort before positive numbers, when compared lexographically.


Constructor Summary
SignedBinaryEncoder()
           
 
Method Summary
 double decodeDouble(byte[] a)
           
 float decodeFloat(byte[] a)
           
 int decodeInt(byte[] a)
           
 long decodeLong(byte[] a)
           
 short decodeShort(byte[] a)
           
 byte[] encodeDouble(double d, byte[] ret)
           
 byte[] encodeFloat(float f, byte[] ret)
           
 byte[] encodeInt(int i, byte[] ret)
           
 byte[] encodeLong(long l, byte[] ret)
           
 byte[] encodeShort(short s, byte[] ret)
           
 
Methods inherited from class org.apache.gora.accumulo.encoders.BinaryEncoder
decodeBoolean, decodeByte, encodeBoolean, encodeBoolean, encodeByte, encodeByte, encodeDouble, encodeFloat, encodeInt, encodeLong, encodeShort, followingKey, lastPossibleKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignedBinaryEncoder

public SignedBinaryEncoder()
Method Detail

encodeShort

public byte[] encodeShort(short s,
                          byte[] ret)
Specified by:
encodeShort in interface Encoder
Overrides:
encodeShort in class BinaryEncoder

decodeShort

public short decodeShort(byte[] a)
Specified by:
decodeShort in interface Encoder
Overrides:
decodeShort in class BinaryEncoder

encodeInt

public byte[] encodeInt(int i,
                        byte[] ret)
Specified by:
encodeInt in interface Encoder
Overrides:
encodeInt in class BinaryEncoder

decodeInt

public int decodeInt(byte[] a)
Specified by:
decodeInt in interface Encoder
Overrides:
decodeInt in class BinaryEncoder

encodeLong

public byte[] encodeLong(long l,
                         byte[] ret)
Specified by:
encodeLong in interface Encoder
Overrides:
encodeLong in class BinaryEncoder

decodeLong

public long decodeLong(byte[] a)
Specified by:
decodeLong in interface Encoder
Overrides:
decodeLong in class BinaryEncoder

encodeDouble

public byte[] encodeDouble(double d,
                           byte[] ret)
Specified by:
encodeDouble in interface Encoder
Overrides:
encodeDouble in class BinaryEncoder

decodeDouble

public double decodeDouble(byte[] a)
Specified by:
decodeDouble in interface Encoder
Overrides:
decodeDouble in class BinaryEncoder

encodeFloat

public byte[] encodeFloat(float f,
                          byte[] ret)
Specified by:
encodeFloat in interface Encoder
Overrides:
encodeFloat in class BinaryEncoder

decodeFloat

public float decodeFloat(byte[] a)
Specified by:
decodeFloat in interface Encoder
Overrides:
decodeFloat in class BinaryEncoder


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