public class ResultAccumulator
extends java.lang.Object
Accumulator for sorted lists of results. This class will return result lists, with the highest-scored result first.
Create one with create(int).
| Modifier and Type | Method and Description |
|---|---|
void |
add(long item,
double score)
Add a basic result to the accumulator.
|
void |
add(Result r)
Add a result to the accumulator.
|
static ResultAccumulator |
create(int n)
Create a new result accumulator.
|
ResultList |
finish()
Finish accumulating and return the accumulated results.
|
ResultMap |
finishMap() |
public static ResultAccumulator create(int n)
Create a new result accumulator.
n - The number of results desired; negative for unlimited.public void add(@Nonnull
Result r)
Add a result to the accumulator.
r - The result to add.public void add(long item,
double score)
Add a basic result to the accumulator.
item - The item ID to add.score - The score to add.public ResultList finish()
Finish accumulating and return the accumulated results.
When this method is called, the accumulator is reset and can be used to accumulate a fresh set of results.
public ResultMap finishMap()