|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.helidb.lang.serializer.CharacterSerializer
org.helidb.lang.serializer.CharacterNullSerializer
public class CharacterNullSerializer
A Serializer for Character values that may be
null. Character values are serialized to a two bytes long,
big-endian byte array. A special, configurable value is used to represent
null.
The singleton instance INSTANCE uses two zero bytes to represent
null values. It may be used instead of instantiating this class.
CharacterSerializer,
Character| Field Summary | |
|---|---|
static CharacterNullSerializer |
INSTANCE
The singleton instance. |
| Fields inherited from class org.helidb.lang.serializer.CharacterSerializer |
|---|
DATA_SIZE |
| Constructor Summary | |
|---|---|
CharacterNullSerializer(byte[] nullValue)
Instantiate this class. |
|
CharacterNullSerializer(char nullValue)
Instantiate this class. |
|
| Method Summary | |
|---|---|
Character |
interpret(byte[] barr)
Interpret the data in the byte array to an object of the type
handled by the Serializer implementation. |
Character |
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(Character value)
Serialize the supplied object into a new byte array. |
int |
serialize(Character value,
byte[] barr,
int offset)
Serialize the supplied object into the byte array. |
| Methods inherited from class org.helidb.lang.serializer.CharacterSerializer |
|---|
encodeCharacter, getCharacter, getSerializedSize, read, read, readCharacter, readCharacter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final CharacterNullSerializer INSTANCE
null values.
| Constructor Detail |
|---|
public CharacterNullSerializer(byte[] nullValue)
nullValue - The value used to represent null Character:s. (big-endian)public CharacterNullSerializer(char nullValue)
nullValue - The value used to represent null
Character:s.| Method Detail |
|---|
public Character interpret(byte[] barr,
int offset,
int length)
Serializerbyte array to an object of the type
handled by the Serializer implementation.
interpret in interface Serializer<Character>interpret in class CharacterSerializerbarr - The byte array containing the data.offset - The start position of the data.length - The length of the data.
Serializer.interpret(byte[])public Character interpret(byte[] barr)
Serializerbyte array to an object of the type
handled by the Serializer implementation.
interpret in interface Serializer<Character>interpret in class CharacterSerializerbarr - The byte array containing the data.
Serializer.interpret(byte[], int, int)
public int serialize(Character value,
byte[] barr,
int offset)
Serializerbyte array.
serialize in interface Serializer<Character>serialize in class CharacterSerializervalue - 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(Character value)
Serializerbyte array.
serialize in interface Serializer<Character>serialize in class CharacterSerializervalue - The object to serialize.
byte array.public boolean isNullValuesPermitted()
Serializernull values?
isNullValuesPermitted in interface Serializer<Character>isNullValuesPermitted in class CharacterSerializertrue, always.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||