|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.helidb.lang.serializer.LongSerializer
org.helidb.lang.serializer.LongNullSerializer
public class LongNullSerializer
A Serializer
for Long
values that may be null
. Long
values are serialized to a eight bytes long, big-endian
byte array. A special, configurable value is used to represent null
.
The singleton instance INSTANCE
uses Long.MIN_VALUE
to
represent null
values. It may be used instead of instantiating this
class.
LongSerializer
,
ConfigurableLengthLongNullSerializer
,
Long
Field Summary | |
---|---|
static LongNullSerializer |
INSTANCE
The singleton instance. |
Fields inherited from class org.helidb.lang.serializer.LongSerializer |
---|
DATA_SIZE |
Constructor Summary | |
---|---|
LongNullSerializer(long nullValue)
Instantiate this class. |
Method Summary | |
---|---|
Long |
interpret(byte[] barr)
Interpret the data in the byte array to an object of the type
handled by the Serializer implementation. |
Long |
interpret(byte[] barr,
int offset,
int length)
Interpret the data in the byte array to an object of the type
handled by the Serializer implementation. |
boolean |
isNullValuesPermitted()
Does this serializer permit null values? |
byte[] |
serialize(Long value)
Serialize the supplied object into a new byte array. |
int |
serialize(Long value,
byte[] barr,
int offset)
Serialize the supplied object into the byte array. |
Methods inherited from class org.helidb.lang.serializer.LongSerializer |
---|
encodeLong, getLong, getSerializedSize, read, read, readLong, readLong |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final LongNullSerializer INSTANCE
Long.MIN_VALUE
to represent null
values. That
null
value has the most significant bit of the most significant
byte set, which may be important to know when working with
Hasher
:s.
Constructor Detail |
---|
public LongNullSerializer(long nullValue)
nullValue
- The value used to represent null
Long
:s.Method Detail |
---|
public Long interpret(byte[] barr, int offset, int length)
Serializer
byte
array to an object of the type
handled by the Serializer
implementation.
interpret
in interface Serializer<Long>
interpret
in class LongSerializer
barr
- The byte
array containing the data.offset
- The start position of the data.length
- The length of the data.
Serializer.interpret(byte[])
public Long interpret(byte[] barr)
Serializer
byte
array to an object of the type
handled by the Serializer
implementation.
interpret
in interface Serializer<Long>
interpret
in class LongSerializer
barr
- The byte
array containing the data.
Serializer.interpret(byte[], int, int)
public int serialize(Long value, byte[] barr, int offset)
Serializer
byte
array.
serialize
in interface Serializer<Long>
serialize
in class LongSerializer
value
- The object to serialize.barr
- The byte array to serialize it to.offset
- The start position to write data at in the byte array.
public byte[] serialize(Long value)
Serializer
byte
array.
serialize
in interface Serializer<Long>
serialize
in class LongSerializer
value
- The object to serialize.
byte
array.public boolean isNullValuesPermitted()
Serializer
null
values?
isNullValuesPermitted
in interface Serializer<Long>
isNullValuesPermitted
in class LongSerializer
true
, always.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |