Package com.yahoo.search.result
Class Relevance
- java.lang.Object
-
- com.yahoo.search.result.Relevance
-
- All Implemented Interfaces:
java.lang.Comparable<Relevance>
public class Relevance extends java.lang.Object implements java.lang.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
Constructors Constructor Description Relevance(double score)
Construct a relevancy object with an initial value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Relevance other)
Compares relevancy values withboolean
equals(java.lang.Object other)
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.java.lang.String
toString()
Returns the score value as a string
-
-
-
Method Detail
-
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
public java.lang.String toString()
Returns the score value as a string- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(Relevance other)
Compares relevancy values with- Specified by:
compareTo
in interfacejava.lang.Comparable<Relevance>
-
equals
public boolean equals(java.lang.Object other)
Compares relevancy values- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hash from the relevancy value- Overrides:
hashCode
in classjava.lang.Object
-
-