Lvg Java
2006p Version

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

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.Trie.PersistentTreeNode
Direct Known Subclasses:
PersistentTrieNode

public class PersistentTreeNode
extends java.lang.Object

This class creates an object of persistent tree node.

History:

Version:
V-2006p
Author:
NLM NLS Development Team

Constructor Summary
PersistentTreeNode()
          Create an object of persistent tree node (defualt).
PersistentTreeNode(int level, long parent, long next, long child, long address)
          Create an object of persistent tree node, using an address, next address, parent address, child address in a random access file and level at the persistent tree.
PersistentTreeNode(long address)
          Create an object of persistent tree node, using an address in a random access file.
 
Method Summary
 long GetAddress()
          Get the address of current persistent tree node at a tree.
 long GetChild()
          Get the child's address of current persistent tree node at a tree.
 int GetLevel()
          Get the level of current persistent tree node at a tree.
 long GetNext()
          Get the next address of current persistent tree node at a tree.
static PersistentTreeNode GetNode(java.io.RandomAccessFile raf, long address)
          Get the current persistent tree node from a specified binary file at a specified address.
 long GetParent()
          Get the parent's address of current persistent tree node at a tree.
static void PrintNode(java.io.RandomAccessFile raf, long address)
          Print all sub tree (list) for a persistent tree node at a specific address of a specific binary file.
 void ReadData(java.io.RandomAccessFile raf)
          Read data from the random access file.
 void SetAddress(long address)
          Set the address of current persistent tree node at a tree.
 void SetChild(long child)
          Set the child's address of current persistent tree node at a tree.
 void SetLevel(int level)
          Set the level of current persistent tree node at a tree.
 void SetNext(long next)
          Set the next address of current persistent tree node at a tree.
 void SetParent(long parent)
          Set the parent's address of current persistent tree node at a tree.
 void WriteData(java.io.RandomAccessFile raf)
          Write data to the random access file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentTreeNode

public PersistentTreeNode()
Create an object of persistent tree node (defualt).


PersistentTreeNode

public PersistentTreeNode(long address)
Create an object of persistent tree node, using an address in a random access file.


PersistentTreeNode

public PersistentTreeNode(int level,
                          long parent,
                          long next,
                          long child,
                          long address)
Create an object of persistent tree node, using an address, next address, parent address, child address in a random access file and level at the persistent tree.

Method Detail

GetLevel

public int GetLevel()
Get the level of current persistent tree node at a tree.

Returns:
level of current persistent tree node at a tree

SetLevel

public void SetLevel(int level)
Set the level of current persistent tree node at a tree.

Parameters:
level - of current persistent tree node at a tree

GetParent

public long GetParent()
Get the parent's address of current persistent tree node at a tree.

Returns:
parent's address of current persistent tree node at a tree

SetParent

public void SetParent(long parent)
Set the parent's address of current persistent tree node at a tree.

Parameters:
parent - parent's address of current persistent tree node at a tree

GetNext

public long GetNext()
Get the next address of current persistent tree node at a tree.

Returns:
next address of current persistent tree node at a tree

SetNext

public void SetNext(long next)
Set the next address of current persistent tree node at a tree.

Parameters:
next - address of current persistent tree node at a tree

GetChild

public long GetChild()
Get the child's address of current persistent tree node at a tree.

Returns:
child's address of current persistent tree node at a tree

SetChild

public void SetChild(long child)
Set the child's address of current persistent tree node at a tree.

Parameters:
child - child's address of current persistent tree node at a tree

SetAddress

public void SetAddress(long address)
Set the address of current persistent tree node at a tree.

Parameters:
address - of current persistent tree node at a tree

GetAddress

public long GetAddress()
Get the address of current persistent tree node at a tree.

Returns:
address of current persistent tree node at a tree

WriteData

public void WriteData(java.io.RandomAccessFile raf)
               throws java.io.IOException
Write data to the random access file. This methods is needed for building the software.

Parameters:
raf - the random access file that data will be written to
Throws:
java.io.IOException - if problems happen when accessing the random access file.

ReadData

public void ReadData(java.io.RandomAccessFile raf)
              throws java.io.IOException
Read data from the random access file. This methods is needed for building the software.

Parameters:
raf - the random access file that data will be read from
Throws:
java.io.IOException - if problems happen when accessing the random access file.

GetNode

public static PersistentTreeNode GetNode(java.io.RandomAccessFile raf,
                                         long address)
                                  throws java.io.IOException
Get the current persistent tree node from a specified binary file at a specified address.

Parameters:
raf - the binary file that the persistent node will be retrieved from
address - the address in the binary file that the persistent node will be retrieved from
Throws:
java.io.IOException - if problems happen when accessing the random access file.

PrintNode

public static void PrintNode(java.io.RandomAccessFile raf,
                             long address)
                      throws java.io.IOException
Print all sub tree (list) for a persistent tree node at a specific address of a specific binary file.

Parameters:
raf - the binary file that the persistent node will be printed out
address - the address in the binary file that the persistent node will be printed out
Throws:
java.io.IOException - if problems happen when accessing the random access file.

Lvg Java
2006p Version

Submit a bug or feature

Copyright © 2006p National Library of Medicine