jdbm.recman
Class FileHeader

java.lang.Object
  extended by jdbm.recman.FileHeader
All Implemented Interfaces:
BlockView

 class FileHeader
extends java.lang.Object
implements BlockView

This class represents a file header. It is a 1:1 representation of the data that appears in block 0 of a file.


Field Summary
(package private) static int NROOTS
          The number of "root" rowids available in the file.
 
Constructor Summary
FileHeader(BlockIo block, boolean isNew)
          Constructs a FileHeader object from a block.
 
Method Summary
(package private)  long getFirstOf(int list)
          Returns the first block of the indicated list
(package private)  long getLastOf(int list)
          Returns the last block of the indicated list
(package private)  long getRoot(int root)
          Returns the indicated root rowid.
(package private)  void setFirstOf(int list, long value)
          Sets the first block of the indicated list
(package private)  void setLastOf(int list, long value)
          Sets the last block of the indicated list
(package private)  void setRoot(int root, long rowid)
          Sets the indicated root rowid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NROOTS

static final int NROOTS
The number of "root" rowids available in the file.

See Also:
Constant Field Values
Constructor Detail

FileHeader

FileHeader(BlockIo block,
           boolean isNew)
Constructs a FileHeader object from a block.

Parameters:
block - The block that contains the file header
isNew - If true, the file header is for a new file.
Throws:
IOException - if the block is too short to keep the file header.
Method Detail

getFirstOf

long getFirstOf(int list)
Returns the first block of the indicated list


setFirstOf

void setFirstOf(int list,
                long value)
Sets the first block of the indicated list


getLastOf

long getLastOf(int list)
Returns the last block of the indicated list


setLastOf

void setLastOf(int list,
               long value)
Sets the last block of the indicated list


getRoot

long getRoot(int root)
Returns the indicated root rowid. A root rowid is a special rowid that needs to be kept between sessions. It could conceivably be stored in a special file, but as a large amount of space in the block header is wasted anyway, it's more useful to store it where it belongs.

See Also:
NROOTS

setRoot

void setRoot(int root,
             long rowid)
Sets the indicated root rowid.

See Also:
getRoot(int), NROOTS


Cees de Groot (C) 2000-2001. All rights reserved http://jdbm.sourceforge.net