Class MkAppLeafEntry

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

    class MkAppLeafEntry
    extends MTreeLeafEntry
    implements MkAppEntry
    Represents an entry in a leaf node of a MkApp-Tree. Additionally to an MTreeLeafEntry an MkAppLeafEntry holds the polynomial approximation of its knn-distances.
    Since:
    0.1
    Author:
    Elke Achtert
    • Constructor Detail

      • MkAppLeafEntry

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

        public MkAppLeafEntry​(DBID objectID,
                              double parentDistance,
                              PolynomialApproximation approximation)
        Constructor.
        Parameters:
        objectID - the id of the underlying data object
        parentDistance - the distance from the underlying data object to its parent's routing object
        approximation - the polynomial approximation of the knn distances
    • Method Detail

      • approximatedValueAt

        public double approximatedValueAt​(int k)
        Returns the approximated value at the specified k.
        Specified by:
        approximatedValueAt in interface MkAppEntry
        Parameters:
        k - the parameter k of the knn distance
        Returns:
        the approximated value at the specified k
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Calls the super method and writes the polynomiale approximation of 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 the polynomial approximation of the knn distances 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.
      • toString

        public java.lang.String toString()
        Returns a string representation of this entry.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this entry