public interface ScoredIdAccumulator
Accumulate a sorted list of scored IDs.
Modifier and Type | Method and Description |
---|---|
List<ScoredId> |
finish()
Accumulate the scores into a sorted scored list and reset the accumulator.
|
LongList |
finishList()
Accumulate the scored items into a list.
|
Long2DoubleMap |
finishMap()
Accumulate the scores into a map 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.
|
boolean isEmpty()
Query whether the accumulator is empty.
true
if the accumulator has no items.int size()
Get the number of items in the accumulator.
void put(long item, double score)
Put a new item in the accumulator. Putting the same item twice does not replace the previous entry - it adds a new entry with the same ID.
item
- The item to add to the accumulator.score
- The item’s score.List<ScoredId> finish()
Accumulate the scores into a sorted scored list and reset the accumulator. Items are sorted in decreasing order of score.
After this method is called, the accumulator is ready for another accumulation.
MutableSparseVector finishVector()
Accumulate the scores into a mutable sparse vector and reset the accumulator.
After this method is called, the accumulator is ready for another accumulation.
Long2DoubleMap finishMap()
Accumulate the scores into a map and reset the accumulator.
After this method is called, the accumulator is ready for another accumulation.
LongSet finishSet()
Accumulate the scored items into a set.
LongList finishList()
Accumulate the scored items into a list.