@InterfaceAudience.Public public class OrderedInt32 extends OrderedBytesBase<Integer>
int
of 32-bits using a fixed-length encoding. Built on
OrderedBytes.encodeInt32(PositionedByteRange, int, Order)
.Modifier and Type | Field and Description |
---|---|
static OrderedInt32 |
ASCENDING
Deprecated.
since 3.0.0 and will be removed in 4.0.0
|
static OrderedInt32 |
DESCENDING
Deprecated.
since 3.0.0 and will be removed in 4.0.0
|
order
Constructor and Description |
---|
OrderedInt32(Order order)
Creates a new 32-bit
int with a fixed-length encoding. |
Modifier and Type | Method and Description |
---|---|
Integer |
decode(PositionedByteRange src)
Read an instance of
T from the buffer src . |
int |
decodeInt(PositionedByteRange src)
Read an
int value from the buffer src . |
int |
encode(PositionedByteRange dst,
Integer val)
Write instance
val into buffer dst . |
Class<Integer> |
encodedClass()
Inform consumers over what type this
DataType operates. |
int |
encodedLength(Integer val)
Inform consumers how long the encoded
byte[] will be. |
int |
encodeInt(PositionedByteRange dst,
int val)
Write instance
val into buffer dst . |
boolean |
isNullable()
Indicates whether this instance supports encoding null values.
|
getOrder, isOrderPreserving, isSkippable, skip
@Deprecated public static final OrderedInt32 ASCENDING
@Deprecated public static final OrderedInt32 DESCENDING
public OrderedInt32(Order order)
int
with a fixed-length encoding.order
- the Order
to usepublic boolean isNullable()
DataType
DataType
s that support null should
treat null as comparing less than any non-null value for default sort ordering purposes.isNullable
in interface DataType<Integer>
isNullable
in class OrderedBytesBase<Integer>
true
when null is supported, false
otherwise.public int encodedLength(Integer val)
DataType
byte[]
will be.val
- The value to check.val
.apublic Class<Integer> encodedClass()
DataType
DataType
operates. Useful when working with bare
DataType
instances.public Integer decode(PositionedByteRange src)
DataType
T
from the buffer src
.src
- the buffer containing the encoded value.public int encode(PositionedByteRange dst, Integer val)
DataType
val
into buffer dst
.dst
- the buffer containing the encoded value.val
- the value to encode onto dst
.public int decodeInt(PositionedByteRange src)
int
value from the buffer src
.src
- the PositionedByteRange
to read the int
fromint
read from the bufferpublic int encodeInt(PositionedByteRange dst, int val)
val
into buffer dst
.dst
- the PositionedByteRange
to write toval
- the value to write to dst
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.