Class CandidateResult

  • All Implemented Interfaces:
    java.lang.Comparable<CandidateResult>
    Direct Known Subclasses:
    FatCandidateResult

    public class CandidateResult
    extends java.lang.Object
    implements java.lang.Comparable<CandidateResult>
    A class used to when maintaining a top-k candidate documents ResultSet.
    Since:
    3.5
    Author:
    Nicola Tonnelotto
    See Also:
    CandidateResultSet
    • Constructor Summary

      Constructors 
      Constructor Description
      CandidateResult​(int docid)
      Make a new CandidateResult for a ResultSet based on the specified docid.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(CandidateResult o)
      .
      boolean equals​(java.lang.Object obj)
      int getDocId()
      Returns the docid of this result
      short getOccurrence()
      Returns the occurrence value of this result
      double getScore()
      Returns the score of this result
      int hashCode()
      void updateOccurrence​(short update)
      Update the occurrence value of this result.
      void updateScore​(double update)
      Increase the score by the specified amount.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CandidateResult

        public CandidateResult​(int docid)
        Make a new CandidateResult for a ResultSet based on the specified docid.
        Parameters:
        docid - of the document
    • Method Detail

      • compareTo

        public int compareTo​(CandidateResult o)
        . Enforces a sort by ascending score.
        Specified by:
        compareTo in interface java.lang.Comparable<CandidateResult>
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getDocId

        public int getDocId()
        Returns the docid of this result
      • getScore

        public double getScore()
        Returns the score of this result
      • getOccurrence

        public short getOccurrence()
        Returns the occurrence value of this result
      • updateScore

        public void updateScore​(double update)
        Increase the score by the specified amount.
        Parameters:
        update - Amount to increase document score by.
      • updateOccurrence

        public void updateOccurrence​(short update)
        Update the occurrence value of this result.
        Parameters:
        update - Mask to OR with current occurrence