@ThreadSafe public class EntityCountRatingVectorPDAO extends Object implements RatingVectorPDAO
Rating vector DAO that counts entities appearing for a user.
| Modifier and Type | Class and Description |
|---|---|
static interface |
EntityCountRatingVectorPDAO.CountedType
Qualifier for the type of entities that are counted to compute user preferences.
|
| Constructor and Description |
|---|
EntityCountRatingVectorPDAO(DataAccessObject dao,
EntityType type)
Construct a rating vector source.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectStream<IdBox<Long2DoubleMap>> |
streamUsers()
Stream all users in the data set.
|
Long2DoubleMap |
userRatingVector(long user)
Get a user’s rating vector.
|
@Inject public EntityCountRatingVectorPDAO(DataAccessObject dao, @EntityCountRatingVectorPDAO.CountedType EntityType type)
Construct a rating vector source.
dao - The data access object.type - @Nonnull public Long2DoubleMap userRatingVector(long user)
RatingVectorPDAOGet a user’s rating vector.
userRatingVector in interface RatingVectorPDAOuser - The rating vector summarizing a user’s historical preferences.public ObjectStream<IdBox<Long2DoubleMap>> streamUsers()
RatingVectorPDAOStream all users in the data set.
streamUsers in interface RatingVectorPDAO