org.terrier.matching.daat
Class CandidateResult

java.lang.Object
  extended by org.terrier.matching.daat.CandidateResult
All Implemented Interfaces:
java.lang.Comparable<CandidateResult>

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
CandidateResult(int id)
          Make a new CandidateResult for a ResultSet based on the specificed docid.
 
Method Summary
 int compareTo(CandidateResult o)
          .
 boolean equals(java.lang.Object obj)
          
 int getDocId()
          Returns the docids 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 id)
Make a new CandidateResult for a ResultSet based on the specificed docid.

Parameters:
id - 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 docids 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


Terrier 3.5. Copyright © 2004-2011 University of Glasgow