public class PersistantTimedLRUCache extends TimedLRUCache
lifeTime, lifeTimeRange
Constructor and Description |
---|
PersistantTimedLRUCache(java.lang.String folder,
long defaultLifeTime)
Create a new PersistantTimedLRUCache instance.
|
PersistantTimedLRUCache(java.lang.String folder,
long defaultLifeTime,
double ratio)
Create a new PresistantTimedLRUCache instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.Object key)
get an object from the cache.
|
java.lang.Object |
getOutDated(java.lang.Object key)
Returns the out dated value if there is any.
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Put a value into the cache using the specified key.
|
java.lang.Object |
remove(java.lang.Object key)
get an object from the cache.
|
java.lang.String |
toString()
Some verbose information about the cache.
|
__sget, __sput, clear, put, setLifeTime, size
public PersistantTimedLRUCache(java.lang.String folder, long defaultLifeTime)
folder
- the folder to write the files to.defaultLifeTime
- the default life time in milli seconds.public PersistantTimedLRUCache(java.lang.String folder, long defaultLifeTime, double ratio)
folder
- the folder to write the files to.defaultLifeTime
- the default life time in milli seconds.ratio
- define the ratio for the underlying cache.public java.lang.Object get(java.lang.Object key)
get
in class TimedLRUCache
key
- the key to perform the lookuppublic java.lang.Object remove(java.lang.Object key)
remove
in class TimedLRUCache
key
- the key to perform the lookuppublic java.lang.Object getOutDated(java.lang.Object key)
key
- the key to lookuppublic java.lang.Object put(java.lang.Object key, java.lang.Object value)
TimedLRUCache
put
in class TimedLRUCache
key
- a key object - not null!value
- a value objectpublic java.lang.String toString()
TimedLRUCache
toString
in class TimedLRUCache