Package org.terrier.matching.daat
Class CandidateResult
- java.lang.Object
-
- org.terrier.matching.daat.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 intcompareTo(CandidateResult o).booleanequals(java.lang.Object obj)intgetDocId()Returns the docid of this resultshortgetOccurrence()Returns the occurrence value of this resultdoublegetScore()Returns the score of this resultinthashCode()voidupdateOccurrence(short update)Update the occurrence value of this result.voidupdateScore(double update)Increase the score by the specified amount.
-
-
-
Method Detail
-
compareTo
public int compareTo(CandidateResult o)
. Enforces a sort by ascending score.- Specified by:
compareToin interfacejava.lang.Comparable<CandidateResult>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.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
-
-