public class JustificationTupleSerializer extends DefaultTupleSerializer<Justification,Justification>
Justification
s.
Note: the encoded key for a Justification
is formed from the 64-bit
long
term identifier for the head of the rule (the entailment)
followed by the term identifier bindings for the tail(s) of the rule. The
bindings are represented as a long[] and indexing into the bindings is by
position. Bindings in the tail of a rule MAY be ZERO (0L) in which case they
are interpreted as wildcards.
Note: No values are stored for this index - all the information is in the keys.
Note: While the static methods used to decode an existing key are safe for
concurrent readers, concurrent readers also form keys using
Justification.getKey(IKeyBuilder, Justification)
and therefore
require a thread-local IKeyBuilder
.
Constructor and Description |
---|
JustificationTupleSerializer()
De-serialization constructor.
|
JustificationTupleSerializer(int N) |
Modifier and Type | Method and Description |
---|---|
Justification |
deserialize(ITuple tuple)
De-serializes an object from the
value stored
in the tuple (ignores the key stored in the tuple). |
Justification |
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(Justification jst)
There is no value for the justifications index.
|
void |
writeExternal(ObjectOutput out) |
getDefaultKeyBuilderFactory, getDefaultLeafKeysCoder, getDefaultValuesCoder, getKeyBuilder, getLeafKeysCoder, getLeafValuesCoder, getPrimaryKeyBuilder, newInstance, setLeafKeysCoder, setLeafValuesCoder, toString
public JustificationTupleSerializer()
public JustificationTupleSerializer(int N)
N
- The #of slots in a statement (3 or 4).public Justification deserialize(ITuple tuple)
DefaultTupleSerializer
value
stored
in the tuple (ignores the key stored in the tuple).deserialize
in interface ITupleSerializer<Justification,Justification>
deserialize
in class DefaultTupleSerializer<Justification,Justification>
tuple
- The tuple.public Justification deserializeKey(ITuple tuple)
DefaultTupleSerializer
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<Justification,Justification>
deserializeKey
in class DefaultTupleSerializer<Justification,Justification>
public byte[] serializeKey(Object obj)
ITupleSerializer
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.
serializeKey
in interface ITupleSerializer<Justification,Justification>
serializeKey
in class DefaultTupleSerializer<Justification,Justification>
obj
- A object (MAY NOT be null
).null
(
null
keys are not allowed into an index).public byte[] serializeVal(Justification jst)
serializeVal
in interface ITupleSerializer<Justification,Justification>
serializeVal
in class DefaultTupleSerializer<Justification,Justification>
jst
- The object to be serialized (MAY be null
).null
if the reference is null
.UnsupportedOperationException
- alwayspublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class DefaultTupleSerializer<Justification,Justification>
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class DefaultTupleSerializer<Justification,Justification>
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.