Lvg Java
2006p Version

gov.nih.nlm.nls.lvg.Trie
Class PersistentTree

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.Trie.PersistentTree

public class PersistentTree
extends java.lang.Object

This class provides a mechanism of persistent tree. One file is capable of storing multiple trie trees. However, we use one only tree in one file in our application for simplicity reason.

The file format is:

History:

Version:
V-2006p
Author:
NLM NLS Development Team
See Also:
Design Document

Constructor Summary
PersistentTree(java.lang.String path)
          Create an object of persistent tree, using a string for the path of the binary file to be strored.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentTree

public PersistentTree(java.lang.String path)
Create an object of persistent tree, using a string for the path of the binary file to be strored.

Method Detail

GetRaf

public java.io.RandomAccessFile GetRaf()
Get the random access file of the current persistent tree.

Returns:
the random access file of the current persistent tree

GetRootAddress

public long GetRootAddress()
Get the address of the root node of the current persistent tree.

Returns:
the address of the root node of the current persistent tree

Add

public void Add(PersistentTreeNode node,
                long parentAddress)
         throws java.io.IOException
Add a persistent node to the current persistent tree at a specific address.

Parameters:
node - the persistent node to be added
parentAddress - the address that the persistent node to be added at
Throws:
java.io.IOException - if probelms happens when accessing random access file

Close

public void Close()
           throws java.io.IOException
Close the random access file of current persistent tree.

Throws:
java.io.IOException - if probelms happens when closing random access file

Lvg Java
2006p Version

Submit a bug or feature

Copyright © 2006p National Library of Medicine