Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.persistent
Class DefaultPageHeader

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.persistent.DefaultPageHeader
All Implemented Interfaces:
PageHeader
Direct Known Subclasses:
TreeIndexHeader

public class DefaultPageHeader
extends Object
implements PageHeader

Default implementation of a page header.

Author:
Elke Achtert

Field Summary
private static int FILE_VERSION
          Magic number.
private  int pageSize
          The size of a page in bytes.
private static int SIZE
          The size of this header.
 
Constructor Summary
DefaultPageHeader()
          Empty constructor for serialization.
DefaultPageHeader(int pageSize)
          Creates a nerw header with the specified parameters.
 
Method Summary
 int getPageSize()
          Returns the size of a page in Bytes.
 void readHeader(RandomAccessFile file)
          Initializes this header from the specified file,
 int size()
          Returns the size of this header in Bytes.
 void writeHeader(RandomAccessFile file)
          Writes this header to the specified file,
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_VERSION

private static final int FILE_VERSION
Magic number.

See Also:
Constant Field Values

SIZE

private static int SIZE
The size of this header.


pageSize

private int pageSize
The size of a page in bytes.

Constructor Detail

DefaultPageHeader

public DefaultPageHeader()
Empty constructor for serialization.


DefaultPageHeader

public DefaultPageHeader(int pageSize)
Creates a nerw header with the specified parameters.

Parameters:
pageSize - the size of a page in bytes
Method Detail

size

public int size()
Returns the size of this header in Bytes.

Specified by:
size in interface PageHeader
Returns:
the size of this header in Bytes

readHeader

public void readHeader(RandomAccessFile file)
                throws IOException
Initializes this header from the specified file,

Specified by:
readHeader in interface PageHeader
Parameters:
file - the file to which this header belongs
Throws:
IOException

writeHeader

public void writeHeader(RandomAccessFile file)
                 throws IOException
Writes this header to the specified file,

Specified by:
writeHeader in interface PageHeader
Parameters:
file - the file to which this header belongs
Throws:
IOException

getPageSize

public int getPageSize()
Returns the size of a page in Bytes.

Specified by:
getPageSize in interface PageHeader
Returns:
the size of a page in Bytes

Release 0.1 (2008-07-10_1838)