@DefaultProvider(value=PackedPreferenceSnapshotBuilder.class) @Shareable public class PackedPreferenceSnapshot extends AbstractPreferenceSnapshot
Note that PackedPreferenceSnapshot is annotated with @Built but is declared as ephemeral. Because of this, the snapshot will not be included in built RecommenderEngines, so it is not Serializable.
cache| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the build context.
|
LongCollection |
getItemIds()
Get the set of item IDs in the snapshot.
|
FastCollection<IndexedPreference> |
getRatings()
Get the collection of ratings in the snapshot.
|
LongCollection |
getUserIds()
Get the set of user IDs in the snapshot.
|
FastCollection<IndexedPreference> |
getUserRatings(long userId)
Get the ratings for a particular user.
|
IdIndexMapping |
itemIndex()
Get the item ID index.
|
static PreferenceSnapshot |
pack(EventDAO dao) |
IdIndexMapping |
userIndex()
Get the user ID index.
|
userRatingVectorpublic static PreferenceSnapshot pack(EventDAO dao)
public LongCollection getUserIds()
PreferenceSnapshotpublic LongCollection getItemIds()
PreferenceSnapshotpublic IdIndexMapping userIndex()
PreferenceSnapshotpublic IdIndexMapping itemIndex()
PreferenceSnapshotpublic FastCollection<IndexedPreference> getRatings()
PreferenceSnapshotModifying the returned indexed preferences will not modify the underlying snapshot.
public FastCollection<IndexedPreference> getUserRatings(long userId)
PreferenceSnapshotModifying the returned indexed preferences will not modify the underlying snapshot.
userId - The user's ID.public void close()
PreferenceSnapshotCloseable.close() to drop the exception that
can be thrown.
After the build context has been closed, all methods are allowed to fail. Objects returned from those methods, however, should continue to be valid.
close in interface Closeableclose in interface AutoCloseableclose in interface PreferenceSnapshotclose in class AbstractPreferenceSnapshot