public class FallbackResult extends Object implements Result
Result from a FallbackItemScorer
.
Modifier and Type | Method and Description |
---|---|
<T extends Result> |
as(Class<T> type)
Convert this result to another type.
|
boolean |
equals(Object o) |
long |
getId()
Get the ID for the result.
|
Result |
getInnerResult()
Get the result from the scorer that produced this score.
|
double |
getScore()
Get the score (value) associated with this result.
|
int |
hashCode() |
boolean |
hasScore()
Query whether the result has a score.
|
boolean |
isFromPrimary()
Query whether this result came from the primary or the baseline item scorer.
|
public long getId()
Result
Get the ID for the result.
public double getScore()
Result
Get the score (value) associated with this result.
getScore
in interface Result
Double.NaN
if the result does not have a score).public boolean hasScore()
Result
Query whether the result has a score. This is equivalent to testing the return value of Result.getScore()
with Double.isNaN(double)
, but may make the resulting code more readable.
@Nullable public <T extends Result> T as(@Nonnull Class<T> type)
Convert this result to another type. If the type is not a superclass of FallbackResult
, then this method delegates to the inner result.
public boolean isFromPrimary()
Query whether this result came from the primary or the baseline item scorer.
true
if the result came from the primary item scorer.public Result getInnerResult()
Get the result from the scorer that produced this score.