public abstract class StatisticsManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
OBLIVION_THRESHOLD
The number of last entries stored for each context in
getUseCount(StatisticsInfo) . |
static int |
RECENCY_OBLIVION_THRESHOLD
The number of last entries stored for each context in
getLastUseRecency(StatisticsInfo) . |
Constructor and Description |
---|
StatisticsManager() |
Modifier and Type | Method and Description |
---|---|
abstract StatisticsInfo[] |
getAllValues(java.lang.String context) |
static StatisticsManager |
getInstance() |
abstract int |
getLastUseRecency(StatisticsInfo info) |
<T,Loc> int |
getUseCount(Key<? extends Statistician<T,Loc>> key,
T element,
Loc location) |
abstract int |
getUseCount(StatisticsInfo info) |
<T,Loc> void |
incUseCount(Key<? extends Statistician<T,Loc>> key,
T element,
Loc location) |
abstract void |
incUseCount(StatisticsInfo info)
Registers a usage of an
|
static <T,Loc> StatisticsInfo |
serialize(Key<? extends Statistician<T,Loc>> key,
T element,
Loc location) |
public static final int OBLIVION_THRESHOLD
getUseCount(StatisticsInfo)
.
If more entries are used over time, use count will be 0 for the most ancient entries.public static final int RECENCY_OBLIVION_THRESHOLD
getLastUseRecency(StatisticsInfo)
.
If more entries are used over time, recency will be Integer.MAX_INT
for the most ancient entries.public static <T,Loc> StatisticsInfo serialize(Key<? extends Statistician<T,Loc>> key, T element, Loc location)
public static StatisticsManager getInstance()
public abstract int getUseCount(StatisticsInfo info)
info.getValue()
was used among all recently registered entries with the same info.getContext()
.incUseCount(StatisticsInfo)
,
OBLIVION_THRESHOLD
public abstract int getLastUseRecency(StatisticsInfo info)
info.getValue()
in all recently registered entries with the same info.getContext()
.
0
if it it's the most recent entry, Integer.MAX_INT
if it was never used or was used too long ago
(more than RECENCY_OBLIVION_THRESHOLD
since other entries with the same context have been registered
with incUseCount(StatisticsInfo)
).public abstract void incUseCount(StatisticsInfo info)
getUseCount(StatisticsInfo)
and getLastUseRecency(StatisticsInfo)
results.public <T,Loc> int getUseCount(Key<? extends Statistician<T,Loc>> key, T element, Loc location)
public <T,Loc> void incUseCount(Key<? extends Statistician<T,Loc>> key, T element, Loc location)
public abstract StatisticsInfo[] getAllValues(java.lang.String context)