@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.
|
userRatingVector
public static PreferenceSnapshot pack(EventDAO dao)
public LongCollection getUserIds()
PreferenceSnapshot
public LongCollection getItemIds()
PreferenceSnapshot
public IdIndexMapping userIndex()
PreferenceSnapshot
public IdIndexMapping itemIndex()
PreferenceSnapshot
public FastCollection<IndexedPreference> getRatings()
PreferenceSnapshot
Modifying the returned indexed preferences will not modify the underlying snapshot.
public FastCollection<IndexedPreference> getUserRatings(long userId)
PreferenceSnapshot
Modifying the returned indexed preferences will not modify the underlying snapshot.
userId
- The user's ID.public void close()
PreferenceSnapshot
Closeable.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 Closeable
close
in interface AutoCloseable
close
in interface PreferenceSnapshot
close
in class AbstractPreferenceSnapshot