Class MkTreeHeader
- java.lang.Object
-
- elki.persistent.DefaultPageHeader
-
- elki.index.tree.TreeIndexHeader
-
- elki.index.tree.metrical.mtreevariants.mktrees.MkTreeHeader
-
- All Implemented Interfaces:
PageHeader
public class MkTreeHeader extends TreeIndexHeader
Encapsulates the header information for subclasses ofAbstractMkTreeUnified. This information is needed for persistent storage.- Since:
- 0.2
- Author:
- Elke Achtert
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetK_max()Returns the parameter k.voidreadHeader(java.nio.ByteBuffer buffer)Initializes this header from the specified file.intsize()ReturnsTreeIndexHeader.size()plus the value ofSIZE).voidwriteHeader(java.nio.ByteBuffer buffer)Writes this header to the specified file.-
Methods inherited from class elki.index.tree.TreeIndexHeader
getDirCapacity, getDirMinimum, getEmptyPagesSize, getLargestPageID, getLeafCapacity, getLeafMinimum, readEmptyPages, setEmptyPagesSize, setLargestPageID, writeEmptyPages
-
Methods inherited from class elki.persistent.DefaultPageHeader
getPageSize, getReservedPages
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.persistent.PageHeader
readHeader, writeHeader
-
-
-
-
Field Detail
-
SIZE
private static int SIZE
The size of this header in Bytes, which is 4 Bytes (fork_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 bytesdirCapacity- the capacity of a directory nodeleafCapacity- the capacity of a leaf nodek_max- the parameter k
-
-
Method Detail
-
readHeader
public void readHeader(java.nio.ByteBuffer buffer)
Initializes this header from the specified file. CallsTreeIndexHeader#readHeader(file)and reads additionally the integer value ofk_maxfrom the file.- Specified by:
readHeaderin interfacePageHeader- Overrides:
readHeaderin classTreeIndexHeader- Parameters:
buffer- byte array with the page data.
-
writeHeader
public void writeHeader(java.nio.ByteBuffer buffer)
Writes this header to the specified file. CallsPageHeader.writeHeader(FileChannel)and writes additionally the integer value ofk_maxto the file.- Specified by:
writeHeaderin interfacePageHeader- Overrides:
writeHeaderin classTreeIndexHeader- Parameters:
buffer- Buffer to write to
-
getK_max
public int getK_max()
Returns the parameter k.- Returns:
- the parameter k
-
size
public int size()
ReturnsTreeIndexHeader.size()plus the value ofSIZE).- Specified by:
sizein interfacePageHeader- Overrides:
sizein classTreeIndexHeader- Returns:
- the size of this header in Bytes
-
-