de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees
Class MkTreeHeader

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.persistent.DefaultPageHeader
      extended by de.lmu.ifi.dbs.elki.index.tree.TreeIndexHeader
          extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.MkTreeHeader
All Implemented Interfaces:
PageHeader

public class MkTreeHeader
extends TreeIndexHeader

Encapsulates the header information for subclasses of AbstractMkTreeUnified. This information is needed for persistent storage.


Field Summary
private  int k_max
          The maximum number k of reverse kNN queries to be supported.
private static int SIZE
          The size of this header in Bytes, which is 4 Bytes (for k_max).
 
Constructor Summary
MkTreeHeader()
          Empty constructor for serialization.
MkTreeHeader(int pageSize, int dirCapacity, int leafCapacity, int k_max)
          Creates a nerw header with the specified parameters.
 
Method Summary
 int getK_max()
          Returns the parameter k.
 void readHeader(RandomAccessFile file)
          Initializes this header from the specified file.
 int size()
          Returns TreeIndexHeader.size() plus the value of SIZE).
 void writeHeader(RandomAccessFile file)
          Writes this header to the specified file.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.TreeIndexHeader
getDirCapacity, getDirMinimum, getEmptyPagesSize, getLargestPageID, getLeafCapacity, getLeafMinimum, readEmptyPages, setEmptyPagesSize, setLargestPageID, writeEmptyPages
 
Methods inherited from class de.lmu.ifi.dbs.elki.persistent.DefaultPageHeader
asByteArray, getPageSize, getReservedPages, readHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE

private static int SIZE
The size of this header in Bytes, which is 4 Bytes (for k_max).


k_max

private int k_max
The maximum number k of reverse kNN queries to be supported.

Constructor Detail

MkTreeHeader

public MkTreeHeader()
Empty constructor for serialization.


MkTreeHeader

public MkTreeHeader(int pageSize,
                    int dirCapacity,
                    int leafCapacity,
                    int k_max)
Creates a nerw header with the specified parameters.

Parameters:
pageSize - the size of a page in bytes
dirCapacity - the capacity of a directory node
leafCapacity - the capacity of a leaf node
k_max - the parameter k
Method Detail

readHeader

public void readHeader(RandomAccessFile file)
                throws IOException
Initializes this header from the specified file. Calls TreeIndexHeader#readHeader(file) and reads additionally the integer value of k_max from the file.

Specified by:
readHeader in interface PageHeader
Overrides:
readHeader in class TreeIndexHeader
Parameters:
file - the file to which this header belongs
Throws:
IOException - if an I/O-error occurs during reading

writeHeader

public void writeHeader(RandomAccessFile file)
                 throws IOException
Writes this header to the specified file. Calls TreeIndexHeader.writeHeader(java.io.RandomAccessFile) and writes additionally the integer value of k_max to the file.

Specified by:
writeHeader in interface PageHeader
Overrides:
writeHeader in class TreeIndexHeader
Parameters:
file - the file to which this header belongs
Throws:
IOException - IOException if an I/O-error occurs during writing

getK_max

public int getK_max()
Returns the parameter k.

Returns:
the parameter k

size

public int size()
Returns TreeIndexHeader.size() plus the value of SIZE).

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

Release 0.4.0 (2011-09-20_1324)