Lvg Java
2006p Version

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

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.Trie.PersistentListNode
Direct Known Subclasses:
PersistentExceptionNode, PersistentRuleNode

public class PersistentListNode
extends java.lang.Object

This class creates an object of persistent list node. It is used as the base class for persistent list node.

History:

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

Constructor Summary
PersistentListNode()
          Create an object of persistent list node (defualt).
PersistentListNode(long address)
          Create an object of persistent list node, using an address in a random access file.
PersistentListNode(long address, long next)
          Create an object of persistent list node, using an address and next address in a random access file.
 
Method Summary
 long GetAddress()
          Get the address of the current persistent node.
 long GetNext()
          Get the address of the next node for the current persistent node.
static PersistentListNode GetNode(java.io.RandomAccessFile raf, long address)
          Get the current persistent list node from a specified binary file at a specified address.
static void PrintList(java.io.RandomAccessFile raf, long address)
          Print all sub tree (list) for a persistent 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 the current persistent node.
 void SetNext(long next)
          Set the address of the next node for the current persistent node.
 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

PersistentListNode

public PersistentListNode()
Create an object of persistent list node (defualt).


PersistentListNode

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


PersistentListNode

public PersistentListNode(long address,
                          long next)
Create an object of persistent list node, using an address and next address in a random access file.

Method Detail

SetNext

public void SetNext(long next)
Set the address of the next node for the current persistent node.

Parameters:
next - the address of the next node for the current persistent node

GetNext

public long GetNext()
Get the address of the next node for the current persistent node.

Returns:
the address of the next node for the current persistent node

SetAddress

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

Parameters:
address - the address of the current persistent node

GetAddress

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

Returns:
address the address of the current persistent node

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. This method is used in it's extended class.

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. This method is used in it's extended class.

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 PersistentListNode GetNode(java.io.RandomAccessFile raf,
                                         long address)
                                  throws java.io.IOException
Get the current persistent list 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.

PrintList

public static void PrintList(java.io.RandomAccessFile raf,
                             long address)
                      throws java.io.IOException
Print all sub tree (list) for a persistent 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