public class NumberIndexEncoder extends Object

Combined number index format, suitable for ordering double and int64 values together.

Implementation conforms to the UTF Style Encoding section of "Number Index Entry Encoding".

See Also
  • https://docs.google.com/document/d/1QX32BCTFWFS_4BneQHFRDnPb2ts04fYrm4Vgy0HLSBg/edit#

Nested Class Summary

class NumberIndexEncoder.DecodedNumberParts The results of decoding NumberParts from a byte array. 

Public Constructor Summary

Public Method Summary

static NumberIndexEncoder.DecodedNumberParts
decode(byte[] bytes)
static double
decodeDouble(byte[] bytes)
static long
decodeLong(byte[] bytes)
static byte[]
encode(NumberParts parts)
Encodes a finite number to bytes suitable for inclusion in an index.
static byte[]
encodeDouble(double value)
static byte[]
encodeLong(long value)

Inherited Method Summary

Public Constructors

public NumberIndexEncoder ()

Public Methods

public static NumberIndexEncoder.DecodedNumberParts decode (byte[] bytes)

Parameters
bytes

public static double decodeDouble (byte[] bytes)

Parameters
bytes

public static long decodeLong (byte[] bytes)

Parameters
bytes

public static byte[] encode (NumberParts parts)

Encodes a finite number to bytes suitable for inclusion in an index. The number is specified as a set of components similar in spirit to the encoding of a double-precision number.

Parameters
parts the number to encode
Returns
  • a newly allocated byte array containing the encoded form of the number

public static byte[] encodeDouble (double value)

Parameters
value

public static byte[] encodeLong (long value)

Parameters
value