public class LimitedSetStatisticEntry<K>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicLong |
counter |
private K |
key |
private long |
lastTime |
Constructor and Description |
---|
LimitedSetStatisticEntry(K aKey)
Creates a new instance of LimitedSetStatisticEntry.
|
Modifier and Type | Method and Description |
---|---|
long |
getCounter()
Returns the counter value.
|
K |
getKey()
Returns this entry key
|
long |
getLastAccessTime()
Returns the timestamp of last entry counter change.
|
long |
incCounter(long aAmount)
Increases counter value by a given amount
|
void |
refreshEntry()
Sets timestamp of last entry counter change to actual time.
|
void |
setCounter(long newValue)
Sets the counter to the given value.
|
aKey
- the entry keyaAmount
- an amount to increase the counternewValue
- new counter value