public class PersistentListNode
extends java.lang.Object
History:
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public PersistentListNode()
public PersistentListNode(long address)
address
- the address of the current persistent nodepublic PersistentListNode(long address, long next)
address
- the address of the current persistent nodenext
- the address of the next node of current persistent nodepublic void SetNext(long next)
next
- the address of the next node of current persistent nodepublic long GetNext()
public void SetAddress(long address)
address
- the address of the current persistent nodepublic long GetAddress()
public void WriteData(java.io.RandomAccessFile raf) throws java.io.IOException
raf
- 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
raf
- the random access file that data will be read fromjava.io.IOException
- if problems happen when accessing the random
access file.public static PersistentListNode 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 void PrintList(java.io.RandomAccessFile raf, long address) throws java.io.IOException
raf
- the binary file that the persistent node will be printed
outaddress
- the address in the binary file that the persistent
node will be printed outjava.io.IOException
- if problems happen when accessing the random
access file.