| java.lang.Object com.anthonyeden.lib.cache.CacheEntry
CacheEntry | public class CacheEntry (Code) | | A single entry in a cache. CacheEntry objects can include a specific
time to live which overrides the default time to live. If the time
to live is -1 then the default is used.
author: Anthony Eden since: 1.1 |
Constructor Summary | |
public | CacheEntry(Object object, long insertTime) Construct a new CacheEntry. | public | CacheEntry(Object object, long insertTime, int ttl) Construct a new CacheEntry with the given time to live. |
CacheEntry | public CacheEntry(Object object, long insertTime)(Code) | | Construct a new CacheEntry.
Parameters: object - The cached object Parameters: insertTime - The time when the object was inserted |
CacheEntry | public CacheEntry(Object object, long insertTime, int ttl)(Code) | | Construct a new CacheEntry with the given time to live.
Parameters: object - The cached object Parameters: insertTime - The time when the object was inserted Parameters: ttl - The time to live of the entry |
getInsertTime | public long getInsertTime()(Code) | | Get the insert time.
The insert time |
getLastRequestTime | public long getLastRequestTime()(Code) | | Get the last request time.
The last request time |
getObject | public Object getObject()(Code) | | Get the cached object.
The cached object |
getTTL | public int getTTL()(Code) | | Get the time to live.
The time to live |
setLastRequestTime | public void setLastRequestTime(long lastRequestTime)(Code) | | Set the last request time.
Parameters: lastRequestTime - The last request time |
setTTL | public void setTTL(int ttl)(Code) | | Set the time to live
Parameters: ttl - The time to live |
|
|