|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.koala.io.NodeConverter<R>
public class NodeConverter<R>
A NodeConverter is capable of reading and writing
SystemNodes to and from byte representation. Some
implementation specific tasks are encapsulated in an IOPolicy.
The format of the byte representation is as follows:
| Constructor Summary | |
|---|---|
NodeConverter(IOPolicy<R> policy)
|
|
| Method Summary | |
|---|---|
static long |
childLocatorsSize(SourceId id,
List<Locator> childLocs)
|
static List<Locator> |
readChildLocators(PositionalDataInput in)
|
SystemNode |
readNode(PositionalDataInput in)
|
SystemNode |
readNode(PositionalDataInput in,
RelativeDualReference<Locator,R> ref)
Reads a node from the input and resolves and updates child pointers in the byte representation if the argument is also an instance of PositionalDataOutput. |
static boolean |
updatePointer(PositionalDataOutput out,
Locator oldPtr,
Locator newPtr)
Request that a pointer in byte representation be updated to point to a new location. |
static void |
writeChildLocators(PositionalDataOutput out,
List<Locator> childLocs)
Writes a list of Locators representing children to an output. |
Locator |
writeNode(PositionalDataOutput out,
SystemNode node)
Recursively writes the specified node and all its children to the output. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NodeConverter(IOPolicy<R> policy)
| Method Detail |
|---|
public Locator writeNode(PositionalDataOutput out,
SystemNode node)
throws IOException
IOPolicy's IOPolicy.nodeSaved(SystemNode, Locator)
method will be called once for each node saved.
IOException
public static void writeChildLocators(PositionalDataOutput out,
List<Locator> childLocs)
throws IOException
Locators representing children to an output.
IOException
public static long childLocatorsSize(SourceId id,
List<Locator> childLocs)
throws IOException
IOException
public static List<Locator> readChildLocators(PositionalDataInput in)
throws IOException
IOException
public static boolean updatePointer(PositionalDataOutput out,
Locator oldPtr,
Locator newPtr)
throws IOException
true if the pointer was successfully updated
and false otherwise.
IOException
public SystemNode readNode(PositionalDataInput in)
throws IOException
IOException
public SystemNode readNode(PositionalDataInput in,
RelativeDualReference<Locator,R> ref)
throws IOException
PositionalDataOutput.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||