Class MkTabLeafEntry

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

    class MkTabLeafEntry
    extends MTreeLeafEntry
    implements MkTabEntry
    Represents an entry in a leaf node of a MkTab-Tree. Additionally to a MTreeLeafEntry a MkTabLeafEntry 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 knn distances of the underlying data object.
    • Constructor Detail

      • MkTabLeafEntry

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

        public MkTabLeafEntry​(DBID objectID,
                              double parentDistance,
                              double[] knnDistances)
        Constructor.
        Parameters:
        objectID - the id of the underlying data object
        parentDistance - the distance from the underlying data object to its parent's routing object
        knnDistances - the knn distances of the underlying data object
    • 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 MTreeLeafEntry
        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 MTreeLeafEntry
        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.