public class NOPTupleSerializer extends DefaultTupleSerializer
KeyBuilder
to format the object as a
key and requires that the values are byte[]s which it passes on without
change. Deserialization of the tuple value always the byte[] itself.Modifier and Type | Field and Description |
---|---|
static ITupleSerializer |
INSTANCE |
Constructor and Description |
---|
NOPTupleSerializer()
De-serialization ctor.
|
NOPTupleSerializer(IKeyBuilderFactory keyBuilderFactory)
Normally callers will use an
ASCIIKeyBuilderFactory since
Unicode support is not required |
Modifier and Type | Method and Description |
---|---|
Object |
deserialize(ITuple tuple)
De-serializes an object from the
value stored
in the tuple (ignores the key stored in the tuple). |
Object |
deserializeKey(ITuple tuple)
This is an unsupported operation.
|
void |
readExternal(ObjectInput in) |
byte[] |
serializeKey(Object obj)
Serialize a facet of an object's state that places the object into the
total sort order for the index.
|
byte[] |
serializeVal(Object obj)
Serializes the object as a byte[] using Java default serialization.
|
void |
writeExternal(ObjectOutput out) |
getDefaultKeyBuilderFactory, getDefaultLeafKeysCoder, getDefaultValuesCoder, getKeyBuilder, getLeafKeysCoder, getLeafValuesCoder, getPrimaryKeyBuilder, newInstance, setLeafKeysCoder, setLeafValuesCoder, toString
public static final transient ITupleSerializer INSTANCE
public NOPTupleSerializer()
public NOPTupleSerializer(IKeyBuilderFactory keyBuilderFactory)
ASCIIKeyBuilderFactory
since
Unicode support is not requiredkeyBuilderFactory
- ASCIIKeyBuilderFactory
public byte[] serializeKey(Object obj)
IAutoboxBTree.insert(Object, Object)
and friends to convert the
key object into an unsigned variable
length byte[].
Note: This handles the conversion between an object and the
unsigned variable length byte[] representation of that
object which determines its place within the total index order. Since
this transform imposes the total order of the index, different techniques
are applied here than are applied to the serialization of the index
values.
Return obj iff it is a byte[]
and otherwise converts
obj to a byte[] using IKeyBuilder.append(Object)
.
serializeKey
in interface ITupleSerializer
serializeKey
in class DefaultTupleSerializer
obj
- A object (MAY NOT be null
).null
(
null
keys are not allowed into an index).public byte[] serializeVal(Object obj)
DefaultTupleSerializer
serializeVal
in interface ITupleSerializer
serializeVal
in class DefaultTupleSerializer
obj
- The object to be serialized (MAY be null
).null
if the reference is null
.public Object deserialize(ITuple tuple)
DefaultTupleSerializer
value
stored
in the tuple (ignores the key stored in the tuple).deserialize
in interface ITupleSerializer
deserialize
in class DefaultTupleSerializer
tuple
- The tuple.public Object deserializeKey(ITuple tuple)
ITupleSerializer
or you can specialize
this one so that it can de-serialize your keys using whichever approach
makes the most sense for your data.deserializeKey
in interface ITupleSerializer
deserializeKey
in class DefaultTupleSerializer
UnsupportedOperationException
- always.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class DefaultTupleSerializer
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class DefaultTupleSerializer
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.