Class MkTabDirectoryEntry

  • All Implemented Interfaces:
    DirectoryEntry, MkTabEntry, MTreeEntry, java.io.Externalizable, java.io.Serializable

    class MkTabDirectoryEntry
    extends MTreeDirectoryEntry
    implements MkTabEntry
    Represents an entry in a directory node of a MkTab-Tree. Additionally to a MTreeLeafEntry a MkTabDirectoryEntry holds a list of its knn distances for parameters k <= k_max.
    Since:
    0.1
    Author:
    Elke Achtert
    • Field Detail

      • knnDistances

        private double[] knnDistances
        The aggregated knn distances of the underlying node.
    • Constructor Detail

      • MkTabDirectoryEntry

        public MkTabDirectoryEntry()
        Empty constructor for serialization purposes.
      • MkTabDirectoryEntry

        public MkTabDirectoryEntry​(DBID objectID,
                                   double parentDistance,
                                   int nodeID,
                                   double coveringRadius,
                                   double[] knnDistances)
        Constructor.
        Parameters:
        objectID - the id of the routing object
        parentDistance - the distance from the routing object of this entry to its parent's routing object
        nodeID - the id of the underlying node
        coveringRadius - the covering radius of the entry
        knnDistances - the aggregated knn distances of the underlying node
    • Method Detail

      • getKnnDistances

        public double[] getKnnDistances()
        Description copied from interface: MkTabEntry
        Returns the list of knn distances of the entry.
        Specified by:
        getKnnDistances in interface MkTabEntry
        Returns:
        the list of knn distances of the entry
      • setKnnDistances

        public void setKnnDistances​(double[] knnDistances)
        Description copied from interface: MkTabEntry
        Sets the knn distances of the entry.
        Specified by:
        setKnnDistances in interface MkTabEntry
        Parameters:
        knnDistances - the knn distances to be set
      • getKnnDistance

        public double getKnnDistance​(int k)
        Description copied from interface: MkTabEntry
        Returns the knn distance of the entry for the specified parameter k.
        Specified by:
        getKnnDistance in interface MkTabEntry
        Parameters:
        k - the parameter k of the knn distance
        Returns:
        the knn distance of the entry
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Calls the super method and writes the parameter k_max and the knn distances of this entry to the specified stream.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class MTreeDirectoryEntry
        Parameters:
        out - the stream to write the object to
        Throws:
        java.io.IOException - Includes any I/O exceptions that may occur
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Calls the super method and reads the parameter k_max and knn distance of this entry from the specified input stream.
        Specified by:
        readExternal in interface java.io.Externalizable
        Overrides:
        readExternal in class MTreeDirectoryEntry
        Parameters:
        in - the stream to read data from in order to restore the object
        Throws:
        java.io.IOException - if I/O errors occur
        java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.