Package com.yahoo.search.result
Class Relevance
java.lang.Object
com.yahoo.search.result.Relevance
- All Implemented Interfaces:
Comparable<Relevance>
A relevance double value. These values should ideally be normalized between 0 and 1 (where 1 means "perfect"),
however this is not enforced.
Sources may create subclasses of this to include additional information or functionality.
- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Compares relevancy values withboolean
Compares relevancy valuesdouble
getScore()
Returns the relevancy score of this, preferably a normalized value between 0 and 1 but this is not guaranteed by this frameworkint
hashCode()
Returns a hash from the relevancy valuevoid
setScore
(double score) Set score value to this value.toString()
Returns the score value as a string
-
Constructor Details
-
Relevance
public Relevance(double score) Construct a relevancy object with an initial value. This initial value should ideally be a normalized value between 0 and 1, but that is not enforced.- Parameters:
score
- the initial value (rank score)
-
-
Method Details
-
setScore
public void setScore(double score) Set score value to this value. This should ideally be a normalized value between 0 and 1, but that is not enforced. NaN is also a legal value, for elements where it makes no sense to assign a particular value. -
getScore
public double getScore()Returns the relevancy score of this, preferably a normalized value between 0 and 1 but this is not guaranteed by this framework -
toString
Returns the score value as a string -
compareTo
Compares relevancy values with- Specified by:
compareTo
in interfaceComparable<Relevance>
-
equals
Compares relevancy values -
hashCode
public int hashCode()Returns a hash from the relevancy value
-