public class PersistentTree
extends java.lang.Object
The file format is:
History:
Constructor and Description |
---|
PersistentTree(java.lang.String path)
Create an object of persistent tree, using a string for the path of
the binary file to be strored.
|
Modifier and Type | Method and Description |
---|---|
void |
Add(PersistentTreeNode node,
long parentAddress)
Add a persistent node to the current persistent tree at a specific
address.
|
void |
Close()
Close the random access file of current persistent tree.
|
java.io.RandomAccessFile |
GetRaf()
Get the random access file of the current persistent tree.
|
long |
GetRootAddress()
Get the address of the root node of the current persistent tree.
|
public PersistentTree(java.lang.String path)
path
- the path of RAF - persistent tree filepublic java.io.RandomAccessFile GetRaf()
public long GetRootAddress()
public void Add(PersistentTreeNode node, long parentAddress) throws java.io.IOException
node
- the persistent node to be addedparentAddress
- the address that the persistent node to be added
atjava.io.IOException
- if probelms happens when accessing random access
filepublic void Close() throws java.io.IOException
java.io.IOException
- if probelms happens when closing random access
file