| com.anthonyeden.lib.cache.Cache
All known Subclasses: com.anthonyeden.lib.cache.AbstractCache,
Cache | public interface Cache (Code) | | Base interface for Cache implementations.
author: Anthony Eden since: 1.1 |
Method Summary | |
public Object | get(Object key) Get the value for the given key from the cache. | public int | getTTL() Get the default time to live. | public void | loadConfiguration(Configuration configuration) Load the Cache's configuration from the given Configuration object. | public void | put(Object key, Object value) Insert a value into the cache. | public void | put(Object key, Object value, int ttl) Insert a value into the cache with the specified time to live. | public void | remove(Object key) Remove a value from the cache. | public void | setTTL(int ttl) Set the default time to live. |
get | public Object get(Object key)(Code) | | Get the value for the given key from the cache. This method may
return null if there is no value or the value is expired.
Parameters: key - The key The value or null |
getTTL | public int getTTL()(Code) | | Get the default time to live.
The default time to live |
put | public void put(Object key, Object value)(Code) | | Insert a value into the cache.
Parameters: key - The key Parameters: value - The value |
put | public void put(Object key, Object value, int ttl)(Code) | | Insert a value into the cache with the specified time to live.
The specified time to live overrides the default time to live.
A value less than 0 is be considered as "infinate".
Parameters: key - The key Parameters: value - The value Parameters: ttl - The time to live |
remove | public void remove(Object key)(Code) | | Remove a value from the cache.
Parameters: key - The key |
setTTL | public void setTTL(int ttl)(Code) | | Set the default time to live.
Parameters: ttl - The new default time to live |
|
|