Class LinearScanKNNByObject<O>

  • Type Parameters:
    O - relation object type
    All Implemented Interfaces:
    KNNSearcher<O>, LinearScanQuery

    public class LinearScanKNNByObject<O>
    extends java.lang.Object
    implements KNNSearcher<O>, LinearScanQuery
    Instance of this query for a particular database.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      KNNList getKNN​(O obj, int k)
      Get the k nearest neighbors for a particular object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • distanceQuery

        private final DistanceQuery<O> distanceQuery
        Hold the distance function to be used.
    • Constructor Detail

      • LinearScanKNNByObject

        public LinearScanKNNByObject​(DistanceQuery<O> distanceQuery)
        Constructor.
        Parameters:
        distanceQuery - Distance function to use
    • Method Detail

      • getKNN

        public KNNList getKNN​(O obj,
                              int k)
        Description copied from interface: KNNSearcher
        Get the k nearest neighbors for a particular object.
        Specified by:
        getKNN in interface KNNSearcher<O>
        Parameters:
        obj - query object
        k - Number of neighbors requested
        Returns:
        neighbors