@InterfaceAudience.Public public class OrderedNumeric extends OrderedBytesBase<Number>
Number of arbitrary precision and variable-length encoding. The resulting length of
encoded values is determined by the numerical (base 100) precision, not absolute value. Use this
data type anywhere you would expect to use a DECIMAL type, a BigDecimal, a
BigInteger, or any time you've parsed floating precision values from text. Built on
OrderedBytes.encodeNumeric(PositionedByteRange, BigDecimal, Order).| Modifier and Type | Field and Description |
|---|---|
static OrderedNumeric |
ASCENDING
Deprecated.
since 3.0.0 and will be removed in 4.0.0
|
static OrderedNumeric |
DESCENDING
Deprecated.
since 3.0.0 and will be removed in 4.0.0
|
order| Constructor and Description |
|---|
OrderedNumeric(Order order)
Creates a new
Number of arbitrary precision and variable-length encoding. |
| Modifier and Type | Method and Description |
|---|---|
Number |
decode(PositionedByteRange src)
Read an instance of
T from the buffer src. |
double |
decodeDouble(PositionedByteRange src)
Read a
double value from the buffer src. |
long |
decodeLong(PositionedByteRange src)
Read a
long value from the buffer src. |
int |
encode(PositionedByteRange dst,
Number val)
Write instance
val into buffer dst. |
Class<Number> |
encodedClass()
Inform consumers over what type this
DataType operates. |
int |
encodedLength(Number val)
Inform consumers how long the encoded
byte[] will be. |
int |
encodeDouble(PositionedByteRange dst,
double val)
Write instance
val into buffer dst. |
int |
encodeLong(PositionedByteRange dst,
long val)
Write instance
val into buffer dst. |
getOrder, isNullable, isOrderPreserving, isSkippable, skip@Deprecated public static final OrderedNumeric ASCENDING
@Deprecated public static final OrderedNumeric DESCENDING
public int encodedLength(Number val)
DataTypebyte[] will be.val - The value to check.val.apublic Class<Number> encodedClass()
DataTypeDataType operates. Useful when working with bare
DataType instances.public Number decode(PositionedByteRange src)
DataTypeT from the buffer src.src - the buffer containing the encoded value.public int encode(PositionedByteRange dst, Number val)
DataTypeval into buffer dst.dst - the buffer containing the encoded value.val - the value to encode onto dst.public long decodeLong(PositionedByteRange src)
long value from the buffer src.src - the PositionedByteRange to read the long fromlong read from the bufferpublic int encodeLong(PositionedByteRange dst, long val)
val into buffer dst.dst - the PositionedByteRange to write toval - the value to write to dstpublic double decodeDouble(PositionedByteRange src)
double value from the buffer src.src - the PositionedByteRange to read the double fromdouble read from the bufferpublic int encodeDouble(PositionedByteRange dst, double val)
val into buffer dst.dst - the PositionedByteRange to write toval - the value to write to dstCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.