org.knime.base.util.kdtree
Class NearestNeighbour<T>

java.lang.Object
  extended by org.knime.base.util.kdtree.NearestNeighbour<T>
Type Parameters:
T - the type of the data object associated with the pattern
All Implemented Interfaces:
Comparable<NearestNeighbour<T>>

public class NearestNeighbour<T>
extends Object
implements Comparable<NearestNeighbour<T>>

This class represents a nearest neighbour found during the search.

Author:
Thorsten Meinl, University of Konstanz

Constructor Summary
NearestNeighbour(T data, double distance)
          Creates a new nearest neighbour.
 
Method Summary
 int compareTo(NearestNeighbour<T> o)
          
 T getData()
          Returns the data associated with the pattern.
 double getDistance()
          Returns the distance from the query pattern.
(package private)  void setDistance(double newDistance)
          Sets the distance of this nearest neighbour.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NearestNeighbour

NearestNeighbour(T data,
                 double distance)
Creates a new nearest neighbour.

Parameters:
data - the data, can be null
distance - the distance from the query pattern
Method Detail

getData

public T getData()
Returns the data associated with the pattern.

Returns:
the data, can be null

getDistance

public double getDistance()
Returns the distance from the query pattern.

Returns:
the distance

setDistance

void setDistance(double newDistance)
Sets the distance of this nearest neighbour.

Parameters:
newDistance - the new distance

compareTo

public int compareTo(NearestNeighbour<T> o)

Specified by:
compareTo in interface Comparable<NearestNeighbour<T>>

toString

public String toString()

Overrides:
toString in class Object


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.