Class RdKNNLeafEntry

  • All Implemented Interfaces:
    elki.data.FeatureVector<java.lang.Number>, elki.data.NumberVector, elki.data.spatial.SpatialComparable, elki.index.tree.LeafEntry, RdKNNEntry, SpatialEntry, java.io.Externalizable, java.io.Serializable

    public class RdKNNLeafEntry
    extends SpatialPointLeafEntry
    implements RdKNNEntry
    Represents an entry in a leaf node of an RdKNN-Tree. Additionally to a SpatialLeafEntry a RdKNNLeafEntry holds the knn distance of the underlying data object.
    Since:
    0.1
    Author:
    Elke Achtert
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface elki.data.NumberVector

        elki.data.NumberVector.Factory<V extends elki.data.NumberVector>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double knnDistance
      The knn distance of the underlying data object.
      private static long serialVersionUID  
      • Fields inherited from interface elki.data.FeatureVector

        TYPE
      • Fields inherited from interface elki.data.NumberVector

        ATTRIBUTE_SEPARATOR, FIELD, FIELD_1D, FIELD_2D, VARIABLE_LENGTH
    • Constructor Summary

      Constructors 
      Constructor Description
      RdKNNLeafEntry()
      Empty constructor for serialization purposes.
      RdKNNLeafEntry​(elki.database.ids.DBID id, elki.data.NumberVector vector, double knnDistance)
      Constructs a new RDkNNLeafEntry object with the given parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getKnnDistance()
      Returns the knn distance of this entry.
      void readExternal​(java.io.ObjectInput in)
      Calls the super method and reads the knn distance of this entry from the specified input stream.
      void setKnnDistance​(double knnDistance)
      Sets the knn distance of this entry.
      void writeExternal​(java.io.ObjectOutput out)
      Calls the super method and writes the knn distance of this entry to the specified stream.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface elki.data.FeatureVector

        toString
      • Methods inherited from interface elki.data.NumberVector

        byteValue, floatValue, getMax, getMin, getValue, intValue, shortValue
      • Methods inherited from interface elki.data.spatial.SpatialComparable

        getDimensionality
    • Field Detail

      • knnDistance

        private double knnDistance
        The knn distance of the underlying data object.
    • Constructor Detail

      • RdKNNLeafEntry

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

        public RdKNNLeafEntry​(elki.database.ids.DBID id,
                              elki.data.NumberVector vector,
                              double knnDistance)
        Constructs a new RDkNNLeafEntry object with the given parameters.
        Parameters:
        id - the unique id of the underlying data object
        vector - the underlying data object
        knnDistance - the knn distance of the underlying data object
    • Method Detail

      • getKnnDistance

        public double getKnnDistance()
        Description copied from interface: RdKNNEntry
        Returns the knn distance of this entry.
        Specified by:
        getKnnDistance in interface RdKNNEntry
        Returns:
        the knn distance of this entry
      • setKnnDistance

        public void setKnnDistance​(double knnDistance)
        Description copied from interface: RdKNNEntry
        Sets the knn distance of this entry.
        Specified by:
        setKnnDistance in interface RdKNNEntry
        Parameters:
        knnDistance - the knn distance to be set
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Calls the super method and writes the knn distance of this entry to the specified stream.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class SpatialPointLeafEntry
        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 knn distance of this entry from the specified input stream.
        Specified by:
        readExternal in interface java.io.Externalizable
        Overrides:
        readExternal in class SpatialPointLeafEntry
        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.