public class SimpleMetaData extends Object implements MetaData
| Modifier and Type | Field and Description |
|---|---|
static double |
DECAY_FACTOR |
| Constructor and Description |
|---|
SimpleMetaData(long timeToLive) |
SimpleMetaData(long created,
long timeToLive) |
SimpleMetaData(long created,
long timeToLive,
long maxIdleTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
decay()
Decreases the hitcount for use with LRU based expunge strategies.
|
long |
getCreated()
Get the timestamp when the entry was created.
|
long |
getExpiry()
Get the timestamp when the entry expires.
|
int |
getHitCount()
Get the number of hits.
|
long |
getLastAccess()
Get the timestamp when the entry was last accessed.
|
long |
getMaxIdleTime()
Get the maximum time that the entry may idle (not being accessed) before being evicted (in
milliseconds).
|
long |
getTimeToLive()
Gets the time to live of this entry (in milliseconds).
|
void |
increaseHitCount() |
boolean |
isExpired()
Check if the entry is expired.
|
boolean |
isStale()
Check if the entry has not been accessed within the idle period.
|
String |
toString() |
void |
update()
Update the entry after a cache hit.
|
public static final double DECAY_FACTOR
public SimpleMetaData(long timeToLive)
public SimpleMetaData(long created,
long timeToLive)
public SimpleMetaData(long created,
long timeToLive,
long maxIdleTime)
public long getTimeToLive()
MetaDatagetTimeToLive in interface MetaDatapublic final long getExpiry()
MetaDatapublic final void update()
MetaDatapublic final long getLastAccess()
MetaDatagetLastAccess in interface MetaDatapublic final int getHitCount()
MetaDatagetHitCount in interface MetaDatapublic boolean isExpired()
MetaDatapublic long getCreated()
MetaDatagetCreated in interface MetaDatapublic boolean isStale()
MetaDatapublic long getMaxIdleTime()
MetaDatagetMaxIdleTime in interface MetaDatapublic void decay()
MetaDatapublic final void increaseHitCount()
Copyright © 2014 dontdrinkandroot. All rights reserved.