Class Relevance

  • All Implemented Interfaces:
    Comparable<Relevance>

    public class Relevance
    extends Object
    implements 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 Detail

      • 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 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 String toString()
        Returns the score value as a string
        Overrides:
        toString in class Object
      • equals

        public boolean equals​(Object other)
        Compares relevancy values
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Returns a hash from the relevancy value
        Overrides:
        hashCode in class Object