de.lmu.ifi.dbs.elki.database.query
Interface DistanceResultPair<D extends Distance<?>>

Type Parameters:
D - Distance type
All Superinterfaces:
Comparable<DistanceResultPair<D>>, PairInterface<D,DBID>
All Known Implementing Classes:
DoubleDistanceResultPair, GenericDistanceResultPair

public interface DistanceResultPair<D extends Distance<?>>
extends PairInterface<D,DBID>, Comparable<DistanceResultPair<D>>

Class that consists of a pair (distance, object ID) commonly returned for kNN and range queries.


Method Summary
 int compareByDistance(DistanceResultPair<D> o)
          Compare value, but by distance only.
 DBID getDBID()
          Getter for second element in pair
 D getDistance()
          Getter for first
 void setDistance(D first)
          Setter for first
 void setID(DBID second)
          Setter for second
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.pairs.PairInterface
getFirst, getSecond
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getDistance

D getDistance()
Getter for first

Returns:
first element in pair

setDistance

void setDistance(D first)
Setter for first

Parameters:
first - new value for first element

getDBID

DBID getDBID()
Getter for second element in pair

Returns:
second element in pair

setID

void setID(DBID second)
Setter for second

Parameters:
second - new value for second element

compareByDistance

int compareByDistance(DistanceResultPair<D> o)
Compare value, but by distance only.

Parameters:
o - Other object
Returns:
comparison result, as by Double.compare(this, other)

Release 0.4.0 (2011-09-20_1324)