QueryProcessor.SF
Class ScoredResultImage

java.lang.Object
  extended by QueryProcessor.ResultImage
      extended by QueryProcessor.SF.ScoredResultImage
All Implemented Interfaces:
java.lang.Comparable<ScoredResultImage>

public class ScoredResultImage
extends ResultImage
implements java.lang.Comparable<ScoredResultImage>

Class representing the result image of a query with a scoring function (includes a score).


Field Summary
protected  double d
          The distance of this image to the query computed using the scoring function
 
Fields inherited from class QueryProcessor.ResultImage
id
 
Constructor Summary
ScoredResultImage(ImageID id, double d)
          Basic constructor.
 
Method Summary
 int compareTo(ScoredResultImage q)
          Compares this object with the specified object for order (increasing distance).
 double getDistance()
          Returns the distance value of this reuslt to the query image.
 java.lang.String toString(int pos, java.lang.String name)
          Returns a string representation of this result image.
 
Methods inherited from class QueryProcessor.ResultImage
equals, equals, getID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

d

protected double d
The distance of this image to the query computed using the scoring function

Constructor Detail

ScoredResultImage

public ScoredResultImage(ImageID id,
                         double d)
Basic constructor.

Parameters:
id - ID of the result image.
d - Distance value.
Method Detail

getDistance

public double getDistance()
Returns the distance value of this reuslt to the query image.

Returns:
The distance value of this reuslt to the query image.

toString

public java.lang.String toString(int pos,
                                 java.lang.String name)
Returns a string representation of this result image.

Overrides:
toString in class ResultImage
Parameters:
pos - Position of this image in the result.
name - Image name.
Returns:
A string representation of this result image.

compareTo

public int compareTo(ScoredResultImage q)
Compares this object with the specified object for order (increasing distance).

Specified by:
compareTo in interface java.lang.Comparable<ScoredResultImage>
Parameters:
q - ScoredResultImage to be compared.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.