public abstract class AbstractRatingVectorPDAO extends java.lang.Object implements RatingVectorPDAO
Base class for helping construct rating vector proxy DAOs.
Modifier and Type | Field and Description |
---|---|
protected DataAccessObject |
dao |
Constructor and Description |
---|
AbstractRatingVectorPDAO(DataAccessObject dao) |
Modifier and Type | Method and Description |
---|---|
protected abstract EntityType |
getEntityType()
Get the desired type of entities.
|
protected abstract Long2DoubleMap |
makeVector(java.util.List<Entity> entities)
Make a vector from entities.
|
ObjectStream<IdBox<Long2DoubleMap>> |
streamUsers()
Stream all users in the data set.
|
Long2DoubleMap |
userRatingVector(long user)
Get a user’s rating vector.
|
protected final DataAccessObject dao
public AbstractRatingVectorPDAO(DataAccessObject dao)
@Nonnull public Long2DoubleMap userRatingVector(long user)
RatingVectorPDAO
Get a user’s rating vector.
userRatingVector
in interface RatingVectorPDAO
user
- The rating vector summarizing a user’s historical preferences.protected abstract EntityType getEntityType()
Get the desired type of entities.
protected abstract Long2DoubleMap makeVector(java.util.List<Entity> entities)
Make a vector from entities.
entities
- The entities.public ObjectStream<IdBox<Long2DoubleMap>> streamUsers()
RatingVectorPDAO
Stream all users in the data set.
streamUsers
in interface RatingVectorPDAO