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 int
compareTo(CandidateResult o)
.boolean
equals(java.lang.Object obj)
int
getDocId()
Returns the docid of this resultshort
getOccurrence()
Returns the occurrence value of this resultdouble
getScore()
Returns the score of this resultint
hashCode()
void
updateOccurrence(short update)
Update the occurrence value of this result.void
updateScore(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:
compareTo
in interfacejava.lang.Comparable<CandidateResult>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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
-
-