public class KeyEncoder
extends java.lang.Object
KeyDecoder
,
DataEncoder
Constructor and Description |
---|
KeyEncoder() |
Modifier and Type | Method and Description |
---|---|
static int |
calculateEncodedLength(java.math.BigDecimal value)
Returns the amount of bytes required to encode a BigDecimal.
|
static int |
calculateEncodedLength(java.math.BigInteger value)
Returns the amount of bytes required to encode a BigInteger.
|
static int |
calculateEncodedLength(byte[] value)
Returns the amount of bytes required to encode a byte array of the given
length.
|
static int |
calculateEncodedLength(byte[] value,
int valueOffset,
int valueLength)
Returns the amount of bytes required to encode the given byte array.
|
static int |
calculateEncodedStringLength(java.lang.String value)
Returns the amount of bytes required to encode the given String.
|
static int |
encode(java.math.BigDecimal value,
byte[] dst,
int dstOffset)
Encodes the given optional BigDecimal into a variable amount of
bytes.
|
static int |
encode(java.math.BigInteger value,
byte[] dst,
int dstOffset)
Encodes the given optional BigInteger into a variable amount of
bytes.
|
static int |
encode(byte[] value,
byte[] dst,
int dstOffset)
Encodes the given optional unsigned byte array into a variable amount of
bytes.
|
static int |
encode(byte[] value,
int valueOffset,
int valueLength,
byte[] dst,
int dstOffset)
Encodes the given optional unsigned byte array into a variable amount of
bytes.
|
static int |
encode(java.lang.String value,
byte[] dst,
int dstOffset)
Encodes the given optional String into a variable amount of bytes.
|
static int |
encodeDesc(java.math.BigDecimal value,
byte[] dst,
int dstOffset)
Encodes the given optional BigDecimal into a variable amount of bytes
for descending order.
|
static int |
encodeDesc(java.math.BigInteger value,
byte[] dst,
int dstOffset)
Encodes the given optional BigInteger into a variable amount of bytes
for descending order.
|
static void |
encodeDesc(boolean value,
byte[] dst,
int dstOffset)
Encodes the given boolean into exactly 1 byte for descending order.
|
static void |
encodeDesc(java.lang.Boolean value,
byte[] dst,
int dstOffset)
Encodes the given Boolean object into exactly 1 byte for descending
order.
|
static int |
encodeDesc(byte[] value,
byte[] dst,
int dstOffset)
Encodes the given optional unsigned byte array into a variable amount of
bytes for descending order.
|
static int |
encodeDesc(byte[] value,
int valueOffset,
int valueLength,
byte[] dst,
int dstOffset)
Encodes the given optional unsigned byte array into a variable amount of
bytes for descending order.
|
static void |
encodeDesc(byte value,
byte[] dst,
int dstOffset)
Encodes the given signed byte into exactly 1 byte for descending order.
|
static int |
encodeDesc(java.lang.Byte value,
byte[] dst,
int dstOffset)
Encodes the given signed Byte object into exactly 1 or 2 bytes for
descending order.
|
static int |
encodeDesc(java.lang.Character value,
byte[] dst,
int dstOffset)
Encodes the given Character object into exactly 1 or 3 bytes for
descending order.
|
static void |
encodeDesc(char value,
byte[] dst,
int dstOffset)
Encodes the given character into exactly 2 bytes for descending order.
|
static void |
encodeDesc(double value,
byte[] dst,
int dstOffset)
Encodes the given double into exactly 8 bytes for descending order.
|
static void |
encodeDesc(java.lang.Double value,
byte[] dst,
int dstOffset)
Encodes the given Double object into exactly 8 bytes for descending
order.
|
static void |
encodeDesc(float value,
byte[] dst,
int dstOffset)
Encodes the given float into exactly 4 bytes for descending order.
|
static void |
encodeDesc(java.lang.Float value,
byte[] dst,
int dstOffset)
Encodes the given Float object into exactly 4 bytes for descending
order.
|
static void |
encodeDesc(int value,
byte[] dst,
int dstOffset)
Encodes the given signed integer into exactly 4 bytes for descending
order.
|
static int |
encodeDesc(java.lang.Integer value,
byte[] dst,
int dstOffset)
Encodes the given signed Integer object into exactly 1 or 5 bytes for
descending order.
|
static void |
encodeDesc(long value,
byte[] dst,
int dstOffset)
Encodes the given signed long into exactly 8 bytes for descending order.
|
static int |
encodeDesc(java.lang.Long value,
byte[] dst,
int dstOffset)
Encodes the given signed Long object into exactly 1 or 9 bytes for
descending order.
|
static void |
encodeDesc(short value,
byte[] dst,
int dstOffset)
Encodes the given signed short into exactly 2 bytes for descending
order.
|
static int |
encodeDesc(java.lang.Short value,
byte[] dst,
int dstOffset)
Encodes the given signed Short object into exactly 1 or 3 bytes for
descending order.
|
static int |
encodeDesc(java.lang.String value,
byte[] dst,
int dstOffset)
Encodes the given optional String into a variable amount of bytes for
descending order.
|
static byte[] |
encodeSingleDesc(byte[] value)
Encodes the given byte array for use when there is only a single
required property, descending order, whose type is a byte array.
|
static byte[] |
encodeSingleDesc(byte[] value,
int prefixPadding,
int suffixPadding)
Encodes the given byte array for use when there is only a single
required property, descending order, whose type is a byte array.
|
static byte[] |
encodeSingleNullableDesc(byte[] value)
Encodes the given byte array for use when there is only a single
nullable property, descending order, whose type is a byte array.
|
static byte[] |
encodeSingleNullableDesc(byte[] value,
int prefixPadding,
int suffixPadding)
Encodes the given byte array for use when there is only a single
nullable property, descending order, whose type is a byte array.
|
public static void encodeDesc(int value, byte[] dst, int dstOffset)
value
- signed integer value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(java.lang.Integer value, byte[] dst, int dstOffset)
value
- optional signed Integer value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(long value, byte[] dst, int dstOffset)
value
- signed long value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(java.lang.Long value, byte[] dst, int dstOffset)
value
- optional signed Long value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(byte value, byte[] dst, int dstOffset)
value
- signed byte value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(java.lang.Byte value, byte[] dst, int dstOffset)
value
- optional signed Byte value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(short value, byte[] dst, int dstOffset)
value
- signed short value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(java.lang.Short value, byte[] dst, int dstOffset)
value
- optional signed Short value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(char value, byte[] dst, int dstOffset)
value
- character value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(java.lang.Character value, byte[] dst, int dstOffset)
value
- optional Character value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(boolean value, byte[] dst, int dstOffset)
value
- boolean value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(java.lang.Boolean value, byte[] dst, int dstOffset)
value
- optional Boolean value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(float value, byte[] dst, int dstOffset)
value
- float value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(java.lang.Float value, byte[] dst, int dstOffset)
value
- optional Float value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(double value, byte[] dst, int dstOffset)
value
- double value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static void encodeDesc(java.lang.Double value, byte[] dst, int dstOffset)
value
- optional Double value to encodedst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encode(java.math.BigInteger value, byte[] dst, int dstOffset)
value
- BigInteger value to encode, may be nulldst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(java.math.BigInteger value, byte[] dst, int dstOffset)
value
- BigInteger value to encode, may be nulldst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int calculateEncodedLength(java.math.BigInteger value)
value
- BigInteger value to encode, may be nullpublic static int encode(java.math.BigDecimal value, byte[] dst, int dstOffset)
Note: It is recommended that value be normalized by stripping trailing zeros. This makes searching by value much simpler.
value
- BigDecimal value to encode, may be nulldst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(java.math.BigDecimal value, byte[] dst, int dstOffset)
Note: It is recommended that value be normalized by stripping trailing zeros. This makes searching by value much simpler.
value
- BigDecimal value to encode, may be nulldst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int calculateEncodedLength(java.math.BigDecimal value)
Note: It is recommended that value be normalized by stripping trailing zeros. This makes searching by value much simpler.
value
- BigDecimal value to encode, may be nullpublic static int encode(byte[] value, byte[] dst, int dstOffset)
value
- byte array value to encode, may be nulldst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encode(byte[] value, int valueOffset, int valueLength, byte[] dst, int dstOffset)
value
- byte array value to encode, may be nullvalueOffset
- offset into byte arrayvalueLength
- length of data in byte arraydst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(byte[] value, byte[] dst, int dstOffset)
value
- byte array value to encode, may be nulldst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(byte[] value, int valueOffset, int valueLength, byte[] dst, int dstOffset)
value
- byte array value to encode, may be nullvalueOffset
- offset into byte arrayvalueLength
- length of data in byte arraydst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int calculateEncodedLength(byte[] value)
value
- byte array value to encode, may be nullpublic static int calculateEncodedLength(byte[] value, int valueOffset, int valueLength)
value
- byte array value to encode, may be nullvalueOffset
- offset into byte arrayvalueLength
- length of data in byte arraypublic static int encode(java.lang.String value, byte[] dst, int dstOffset)
Strings are encoded in a fashion similar to UTF-8, in that ASCII characters are usually written in one byte. This encoding is more efficient than UTF-8, but it isn't compatible with UTF-8.
value
- String value to encode, may be nulldst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int encodeDesc(java.lang.String value, byte[] dst, int dstOffset)
Strings are encoded in a fashion similar to UTF-8, in that ASCII characters are usually written in one byte. This encoding is more efficient than UTF-8, but it isn't compatible with UTF-8.
value
- String value to encode, may be nulldst
- destination for encoded bytesdstOffset
- offset into destination arraypublic static int calculateEncodedStringLength(java.lang.String value)
value
- String to encode, may be nullpublic static byte[] encodeSingleDesc(byte[] value)
public static byte[] encodeSingleDesc(byte[] value, int prefixPadding, int suffixPadding)
prefixPadding
- amount of extra bytes to allocate at start of encoded byte arraysuffixPadding
- amount of extra bytes to allocate at end of encoded byte arraypublic static byte[] encodeSingleNullableDesc(byte[] value)
public static byte[] encodeSingleNullableDesc(byte[] value, int prefixPadding, int suffixPadding)
prefixPadding
- amount of extra bytes to allocate at start of encoded byte arraysuffixPadding
- amount of extra bytes to allocate at end of encoded byte arrayCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.