java.io.Serializable, java.util.Comparator<java.lang.Number>, NumericValueConverter, ValueConverterpublic final class LongConverter extends java.lang.Object implements NumericValueConverter, java.io.Serializable
| Constructor | Description |
|---|---|
LongConverter() |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.Number |
add(java.lang.Number num1,
java.lang.Number num2,
java.lang.Number... numbers) |
Adds two or more numbers.
|
int |
compare(java.lang.Number num1,
java.lang.Number num2) |
Compares two numbers as longs.
|
java.lang.Object |
decodeValue(byte[] bytes) |
Decode a byte array and convert it into an object depending on the
converter implementation.
|
byte[] |
encodeValue(java.lang.Object value) |
Encode an object as a byte array depending on the converter implementation.
|
static long |
invertLong(long key) |
Converts a timestamp into it's inverse timestamp to be used in (row) keys
where we want to have the most recent timestamp in the top of the table
(scans start at the most recent timestamp first).
|
public byte[] encodeValue(java.lang.Object value)
throws java.io.IOException
ValueConverterencodeValue in interface ValueConvertervalue - Value to be encoded.java.io.IOException - if any problem is encountered while encoding.public java.lang.Object decodeValue(byte[] bytes)
throws java.io.IOException
ValueConverterdecodeValue in interface ValueConverterbytes - Byte array to be decoded.java.io.IOException - if any problem is encountered while decoding.public int compare(java.lang.Number num1,
java.lang.Number num2)
compare in interface java.util.Comparator<java.lang.Number>num1 - the first Long to compare.num2 - the second Long to compare.public java.lang.Number add(java.lang.Number num1,
java.lang.Number num2,
java.lang.Number... numbers)
NumericValueConverteradd in interface NumericValueConverternum1 - the first number to add.num2 - the second number to add.numbers - Rest of the numbers to be added.public static long invertLong(long key)
key - value to be inverted so that the latest version will be first in
a scan.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.