public class PersistentTrieNode extends PersistentTreeNode
History:
| Constructor and Description |
|---|
PersistentTrieNode(char key,
long ruleAddress)
Create an object of persistent tree node, using key (a character from
suffix) and the address of a rule.
|
PersistentTrieNode(int level,
long parent,
long next,
long child,
long address)
Create an object of persistent trie node, using an address, next address,
parent address, child address in a random access file and level at the
persistent tree.
|
PersistentTrieNode(long address)
Create an object of persistent trie node, using an address in a random
access file.
|
| Modifier and Type | Method and Description |
|---|---|
char |
GetKey()
Get the key of current trie node.
|
static PersistentTreeNode |
GetNode(java.io.RandomAccessFile raf,
long address)
Get the current persistent trie node from a specified binary file at
a specified address.
|
long |
GetRuleAddress()
Get the rule address of current trie node.
|
static int |
PrintNode(java.io.RandomAccessFile trieRaf,
long address,
java.lang.String rulePath,
java.lang.String exceptionPath)
Print all sub tree (list) for a persistent trie node at a specific address
of a specific binary file.
|
void |
ReadData(java.io.RandomAccessFile raf)
Read data from the random access file.
|
void |
WriteData(java.io.RandomAccessFile raf)
Write data to the random access file.
|
GetAddress, GetChild, GetLevel, GetNext, GetParent, PrintNode, SetAddress, SetChild, SetLevel, SetNext, SetParentpublic PersistentTrieNode(long address)
address - address of current trie nodepublic PersistentTrieNode(char key,
long ruleAddress)
key - of current trie noderuleAddress - address of current trie nodepublic PersistentTrieNode(int level,
long parent,
long next,
long child,
long address)
level - level of current persistent tree node at a tire treeparent - parent's address of current persistent tree node at a treenext - address of current persistent tree node at a treechild - child of current persistent tree node at a trie treeaddress - address in a random access file.public char GetKey()
public long GetRuleAddress()
public void WriteData(java.io.RandomAccessFile raf)
throws java.io.IOException
WriteData in class PersistentTreeNoderaf - the random access file that data will be written tojava.io.IOException - if problems happen when accessing the random
access file.public void ReadData(java.io.RandomAccessFile raf)
throws java.io.IOException
ReadData in class PersistentTreeNoderaf - the random access file that data will be read fromjava.io.IOException - if problems happen when accessing the random
access file.public static PersistentTreeNode GetNode(java.io.RandomAccessFile raf, long address) throws java.io.IOException
raf - the binary file that the persistent node will be retrieved
fromaddress - the address in the binary file that the persistent
node will be retrieved fromjava.io.IOException - if problems happen when accessing the random
access file.public static int PrintNode(java.io.RandomAccessFile trieRaf,
long address,
java.lang.String rulePath,
java.lang.String exceptionPath)
throws java.io.IOException
trieRaf - the binary file that the persistent trie node will be
printed outaddress - the address in the binary file that the persistent
trie node will be printed outrulePath - the path/name of the LVG persistent ruleexceptionPath - the path/name of the LVG persistent exceptionjava.io.IOException - if problems happen when accessing the random
access file.