@Shareable @Immutable @DefaultProvider(value=InteractionStatistics.ISProvider.class) public class InteractionStatistics extends java.lang.Object implements java.io.Serializable
Interaction statistics, counting the number of times an item has been interacted with. The interaction entity must have CommonAttributes.ITEM_ID
attributes.
Modifier and Type | Class and Description |
---|---|
static class |
InteractionStatistics.CountSumISProvider
Provider that counts item interactions.
|
static class |
InteractionStatistics.ISProvider
Provider that counts item interactions.
|
Constructor and Description |
---|
InteractionStatistics(EntityType type,
Long2IntMap counts)
Construct a new interaction statistics object.
|
Modifier and Type | Method and Description |
---|---|
static InteractionStatistics |
create(DataAccessObject dao)
Construct a new interaction statistics object that counts ratings.
|
static InteractionStatistics |
create(DataAccessObject dao,
EntityType type)
Construct a new interaction statistics object.
|
EntityType |
getEntityType()
Get the interaction entity type.
|
int |
getInteractionCount(long item)
Get the number of interactions for an item.
|
LongList |
getItemsByPopularity()
Get the list of items by decreasing popularity.
|
LongSortedSet |
getKnownItems()
Get the set of known items.
|
public InteractionStatistics(EntityType type, Long2IntMap counts)
Construct a new interaction statistics object.
type
- The counted entity type.counts
- A map of item interaction counts.public static InteractionStatistics create(DataAccessObject dao, EntityType type)
Construct a new interaction statistics object.
dao
- The DAO.type
- The entity type to count.public static InteractionStatistics create(DataAccessObject dao)
Construct a new interaction statistics object that counts ratings.
dao
- The DAO.public EntityType getEntityType()
Get the interaction entity type.
public int getInteractionCount(long item)
Get the number of interactions for an item.
item
- The item.item
.public LongSortedSet getKnownItems()
Get the set of known items.
public LongList getItemsByPopularity()
Get the list of items by decreasing popularity.