@Shareable @Singleton public final class EventCountUserHistorySummarizer extends java.lang.Object implements UserHistorySummarizer
Modifier and Type | Field and Description |
---|---|
protected java.lang.Class<? extends Event> |
wantedType |
Constructor and Description |
---|
EventCountUserHistorySummarizer()
Create a summarizer that counts all events.
|
EventCountUserHistorySummarizer(java.lang.Class<? extends Event> type)
Create a summarizer that counts events of a particular type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.Class<? extends Event> |
eventTypeWanted()
Get the supertype of all events required by this summarizer.
|
int |
hashCode() |
SparseVector |
summarize(UserHistory<? extends Event> history)
Compute a vector summary of a user's history.
|
protected final java.lang.Class<? extends Event> wantedType
public EventCountUserHistorySummarizer()
@Inject public EventCountUserHistorySummarizer(@EventType @Nonnull java.lang.Class<? extends Event> type)
type
- The type of event to count.public java.lang.Class<? extends Event> eventTypeWanted()
UserHistorySummarizer
eventTypeWanted
in interface UserHistorySummarizer
@Nonnull public SparseVector summarize(@Nonnull UserHistory<? extends Event> history)
UserHistorySummarizer
summarize
in interface UserHistorySummarizer
history
- The history to summarize.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object