suncertify.db.util
Class RecordStructure

java.lang.Object
  |
  +--suncertify.db.util.RecordStructure

public class RecordStructure
extends java.lang.Object

The clas contains information about the record structure in a database


Constructor Summary
RecordStructure(int overallLength, short numberOfFields, java.io.RandomAccessFile randomAccessFile)
          RecordStructure constructor, it reads all the header information from the db file.
 
Method Summary
 int getFieldSize(int i)
          Method returns number of bytes for the specified column
 int getNumberOfBytesOfHeader()
          Method returns overall number of bytes taken by the header infromation
 int getRecordLength()
          Rturns the total length of the record in bytes
 java.lang.String toString()
          Method returns all the header information nicly formated for printing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RecordStructure

public RecordStructure(int overallLength,
                       short numberOfFields,
                       java.io.RandomAccessFile randomAccessFile)
                throws java.io.IOException
RecordStructure constructor, it reads all the header information from the db file. and sets the values of internal fields. /see all gethers methods/

Parameters:
overallLength - - total overall length in bytes of each record
numberOfFields - - number of fields in a record
randomAccessFile - - reference to the db file
Throws:
java.io.IOException - - thrown in case of file access problems
Method Detail

toString

public java.lang.String toString()
Method returns all the header information nicly formated for printing

Overrides:
toString in class java.lang.Object
Returns:
all the header information

getNumberOfBytesOfHeader

public int getNumberOfBytesOfHeader()
Method returns overall number of bytes taken by the header infromation

Returns:
overall number of bytes taken by the header infromation

getRecordLength

public int getRecordLength()
Rturns the total length of the record in bytes

Returns:
the total length of the record in bytes

getFieldSize

public int getFieldSize(int i)
Method returns number of bytes for the specified column

Parameters:
i - - index of the data column
Returns:
number of bytes in the requested column