Class RdKNNTreeHeader

  • All Implemented Interfaces:
    elki.persistent.PageHeader

    class RdKNNTreeHeader
    extends elki.index.tree.TreeIndexHeader
    Encapsulates the header information of a RDkNN-Tree. This information is needed for persistent storage.
    Since:
    0.1
    Author:
    Elke Achtert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (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

      Constructors 
      Constructor Description
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void readHeader​(java.nio.ByteBuffer buffer)
      Initializes this header from the specified file.
      int size()
      Returns TreeIndexHeader.size() plus the value of SIZE).
      void writeHeader​(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 (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​(java.nio.ByteBuffer buffer)
        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 elki.persistent.PageHeader
        Overrides:
        readHeader in class elki.index.tree.TreeIndexHeader
      • writeHeader

        public void writeHeader​(java.nio.ByteBuffer buffer)
        Writes this header to the specified file. Calls PageHeader.writeHeader(FileChannel) and writes additionally the integer value of k_max to the file.
        Specified by:
        writeHeader in interface elki.persistent.PageHeader
        Overrides:
        writeHeader in class elki.index.tree.TreeIndexHeader
      • size

        public int size()
        Returns TreeIndexHeader.size() plus the value of SIZE).
        Specified by:
        size in interface elki.persistent.PageHeader
        Overrides:
        size in class elki.index.tree.TreeIndexHeader