public final class UnlimitedScoredItemAccumulator extends Object implements ScoredItemAccumulator
| Constructor and Description |
|---|
UnlimitedScoredItemAccumulator() |
| Modifier and Type | Method and Description |
|---|---|
List<ScoredId> |
finish()
Accumulate the scores into a sorted scored list and reset the
accumulator.
|
LongSet |
finishSet()
Accumulate the scored items into a set.
|
MutableSparseVector |
finishVector()
Accumulate the scores into a mutable sparse vector and
reset the accumulator.
|
boolean |
isEmpty()
Query whether the accumulator is empty.
|
void |
put(long item,
double score)
Put a new item in the accumulator.
|
int |
size()
Get the number of items in the accumulator.
|
public boolean isEmpty()
ScoredItemAccumulatorisEmpty in interface ScoredItemAccumulatortrue if the accumulator has no items.public int size()
ScoredItemAccumulatorsize in interface ScoredItemAccumulatorpublic void put(long item,
double score)
ScoredItemAccumulatorput in interface ScoredItemAccumulatoritem - The item to add to the accumulator.score - The item's score.public List<ScoredId> finish()
ScoredItemAccumulatorAfter this method is called, the accumulator is ready for another accumulation.
finish in interface ScoredItemAccumulatorpublic MutableSparseVector finishVector()
ScoredItemAccumulatorAfter this method is called, the accumulator is ready for another accumulation.
finishVector in interface ScoredItemAccumulatorpublic LongSet finishSet()
ScoredItemAccumulatorfinishSet in interface ScoredItemAccumulator