Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rdknn
Class RdKNNTreeHeader

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.spatial.rstarvariants.rdknn.RdKNNTreeHeader
All Implemented Interfaces:
PageHeader

 class RdKNNTreeHeader
extends TreeIndexHeader

Encapsulates the header information of a RDkNN-Tree. This information is needed for persistent storage.

Author:
Elke Achtert

Field Summary
(package 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
RdKNNTreeHeader()
          Empty constructor for serialization.
RdKNNTreeHeader(int pageSize, int dirCapacity, int leafCapacity, int dirMinimum, int leafMinimum, int k_max)
          Creates a new header with the specified parameters.
 
Method Summary
 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, getLeafCapacity, getLeafMinimum
 
Methods inherited from class de.lmu.ifi.dbs.elki.persistent.DefaultPageHeader
asByteArray, getPageSize, 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

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

Constructor Detail

RdKNNTreeHeader

public RdKNNTreeHeader()
Empty constructor for serialization.


RdKNNTreeHeader

public RdKNNTreeHeader(int pageSize,
                       int dirCapacity,
                       int leafCapacity,
                       int dirMinimum,
                       int leafMinimum,
                       int k_max)
Creates a new header with the specified parameters.

Parameters:
pageSize - the size of a page in bytes
dirCapacity - the maximum number of entries in a directory node
leafCapacity - the maximum number of entries in a leaf node
dirMinimum - the minimum number of entries in a directory node
leafMinimum - the minimum number of entries in a leaf node
k_max - the maximum number k of reverse kNN queries to be supported
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

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.2.1 (2009-07-13_1605)