@Immutable public class BasicResultMap extends AbstractLong2ObjectMap<Result> implements LenskitResultMap
Standard result map implementation.
AbstractLong2ObjectMap.BasicEntry<V>Long2ObjectMap.Entry<V>, Long2ObjectMap.FastEntrySet<V>defRetValue| Constructor and Description |
|---|
BasicResultMap(Iterable<? extends Result> objs)
Create a new result map from a collection of results.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(long l) |
ObjectSet<Map.Entry<Long,Result>> |
entrySet() |
Result |
get(long l)
Get a result without boxing the key.
|
double |
getScore(long id)
Get the score associated with an ID.
|
Iterator<Result> |
iterator() |
LongSet |
keySet() |
ObjectSet<Long2ObjectMap.Entry<Result>> |
long2ObjectEntrySet() |
Long2DoubleSortedMap |
scoreMap()
View this result set as a map from longs to doubles.
|
int |
size() |
ObjectCollection<Result> |
values() |
containsValue, equals, hashCode, isEmpty, putAll, toStringclear, containsKey, defaultReturnValue, defaultReturnValue, get, put, put, remove, removeclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratordefaultReturnValue, defaultReturnValue, put, removeclear, containsKey, get, put, removeclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAllpublic Long2DoubleSortedMap scoreMap()
ResultMapView this result set as a map from longs to doubles.
scoreMap in interface ResultMapscoreMap in interface LenskitResultMappublic ObjectSet<Long2ObjectMap.Entry<Result>> long2ObjectEntrySet()
long2ObjectEntrySet in interface Long2ObjectMap<Result>public Result get(long l)
ResultMapGet a result without boxing the key.
get in interface Long2ObjectFunction<Result>get in interface ResultMapl - The item ID.null if the key is not in the map.public boolean containsKey(long l)
containsKey in interface Long2ObjectFunction<Result>containsKey in class AbstractLong2ObjectMap<Result>public ObjectCollection<Result> values()
values in interface Long2ObjectMap<Result>values in interface Map<Long,Result>values in class AbstractLong2ObjectMap<Result>public ObjectSet<Map.Entry<Long,Result>> entrySet()
entrySet in interface Long2ObjectMap<Result>entrySet in interface Map<Long,Result>entrySet in class AbstractLong2ObjectMap<Result>public LongSet keySet()
keySet in interface Long2ObjectMap<Result>keySet in interface Map<Long,Result>keySet in class AbstractLong2ObjectMap<Result>public int size()
public double getScore(long id)
ResultMapGet the score associated with an ID.
getScore in interface ResultMapid - The ID to query.id, or Double.NaN if there is no score.