|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.types.OrderedBytesBase<Number>
org.apache.hadoop.hbase.types.OrderedNumeric
@InterfaceAudience.Public @InterfaceStability.Evolving public class OrderedNumeric
An 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)
.
Field Summary | |
---|---|
static OrderedNumeric |
ASCENDING
|
static OrderedNumeric |
DESCENDING
|
Fields inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase |
---|
order |
Constructor Summary | |
---|---|
protected |
OrderedNumeric(Order order)
|
Method Summary | |
---|---|
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 . |
Methods inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase |
---|
getOrder, isNullable, isOrderPreserving, isSkippable, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final OrderedNumeric ASCENDING
public static final OrderedNumeric DESCENDING
Constructor Detail |
---|
protected OrderedNumeric(Order order)
Method Detail |
---|
public int encodedLength(Number val)
DataType
byte[]
will be.
val
- The value to check.
val
.apublic Class<Number> encodedClass()
DataType
DataType
operates. Useful
when working with bare DataType
instances.
public Number decode(PositionedByteRange src)
DataType
T
from the buffer src
.
src
- the buffer containing the encoded value.public int encode(PositionedByteRange dst, Number val)
DataType
val
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
.
public int encodeLong(PositionedByteRange dst, long val)
val
into buffer dst
.
public double decodeDouble(PositionedByteRange src)
double
value from the buffer src
.
public int encodeDouble(PositionedByteRange dst, double val)
val
into buffer dst
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |