public interface Long2DoubleAccumulator
Accumulate a sorted list of scored IDs.
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
isEmpty()
Query whether the accumulator is empty.
|
void |
put(long item,
double score)
Put a new item in the accumulator.
|
default void |
putAll(Long2DoubleMap map)
Add all items from a map to 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.default void putAll(Long2DoubleMap map)
Add all items from a map to the accumulator.
map
- The map.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.