public class DefaultDirectoryPageCoder extends Object implements IAbstractNodeDataCoder<IDirectoryData>, Externalizable
IDirectoryData
records.Constructor and Description |
---|
DefaultDirectoryPageCoder()
De-serialization ctor.
|
Modifier and Type | Method and Description |
---|---|
IDirectoryData |
decode(AbstractFixedByteArrayBuffer data)
Return an
IAbstractNodeData instance which can access the coded
data. |
AbstractFixedByteArrayBuffer |
encode(IDirectoryData node,
DataOutputBuffer buf)
Encode the data, returning a slice containing the coded data.
|
IDirectoryData |
encodeLive(IDirectoryData node,
DataOutputBuffer buf)
Encode the data, returning a reference to a coded instance of the data.
|
boolean |
isLeafDataCoder()
No.
|
boolean |
isNodeDataCoder()
Yes.
|
void |
readExternal(ObjectInput in) |
static StringBuilder |
toString(IDirectoryData node,
StringBuilder sb)
Utility method formats the
IDirectoryData . |
void |
writeExternal(ObjectOutput out) |
public DefaultDirectoryPageCoder()
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public final boolean isLeafDataCoder()
isLeafDataCoder
in interface IAbstractNodeDataCoder<IDirectoryData>
ILeafData
public boolean isNodeDataCoder()
isNodeDataCoder
in interface IAbstractNodeDataCoder<IDirectoryData>
INodeData
public IDirectoryData decode(AbstractFixedByteArrayBuffer data)
IAbstractNodeDataCoder
IAbstractNodeData
instance which can access the coded
data.decode
in interface IAbstractNodeDataCoder<IDirectoryData>
data
- The record containing the coded data.public IDirectoryData encodeLive(IDirectoryData node, DataOutputBuffer buf)
IAbstractNodeDataCoder
Note: Implementations of this method are typically heavy. While it is
always valid to IAbstractNodeDataCoder.encode(IAbstractNodeData, DataOutputBuffer)
an
IAbstractNodeData
, DO NOT invoke this arbitrarily on
data which may already be coded. The IAbstractNodeCodedData
interface will always be implemented for coded data.
encodeLive
in interface IAbstractNodeDataCoder<IDirectoryData>
node
- The node or leaf data.buf
- A buffer on which the coded data will be written.IAbstractNodeData.data()
is a slice onto the
post-condition state of the caller's buffer whose view
corresponds to the coded record. This may be written directly
onto an output stream or the slice may be converted to an exact
fit byte[].public AbstractFixedByteArrayBuffer encode(IDirectoryData node, DataOutputBuffer buf)
IAbstractNodeDataCoder
Note: Implementations of this method are typically heavy. While it is
always valid to IAbstractNodeDataCoder.encode(IAbstractNodeData, DataOutputBuffer)
an
IAbstractNodeData
, DO NOT invoke this arbitrarily on
data which may already be coded. The IAbstractNodeCodedData
interface will always be implemented for coded data.
encode
in interface IAbstractNodeDataCoder<IDirectoryData>
node
- The node or leaf data.buf
- A buffer on which the coded data will be written.public static StringBuilder toString(IDirectoryData node, StringBuilder sb)
IDirectoryData
.node
- A node data record.sb
- The representation will be written onto this object.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.