| Constructor and Description |
|---|
DefaultCacheImpl()
Initializes the cache with auto expiration OFF.
|
DefaultCacheImpl(long autoExpireTimeInMs)
Initialize the cache with auto expiration ON.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the entire cache.
|
Object |
get(Object key)
Returns the cached value corresponding to key.
|
long |
getAutoExpireTimeInMs() |
long |
getLastUpateTime(Object key)
Returns the last update time in milliseconds since January 1, 1970, 00:00:00 GMT for the cached entry.
|
void |
put(Object key,
Object value)
Puts the key-value pair in the cache.
|
void |
remove(Object key)
Removes the entry from the cache.
|
void |
setAutoExpireTimeInMs(long autoExpireTimeInMs)
Set the auto expiry time, after which an entry will expire after it is put in cache.
|
public DefaultCacheImpl()
public DefaultCacheImpl(long autoExpireTimeInMs)
autoExpireTimeInMs - Time in milliseconds after which entries in cache expirepublic void clear()
Cachepublic Object get(Object key)
Cachepublic void put(Object key, Object value)
CacheCache.getAutoExpireTimeInMs() milliseconds.public void remove(Object key)
Cachepublic long getLastUpateTime(Object key)
CachegetLastUpateTime in interface Cachekey - The key for which last update time is requiredpublic long getAutoExpireTimeInMs()
getAutoExpireTimeInMs in interface Cachepublic void setAutoExpireTimeInMs(long autoExpireTimeInMs)
CachesetAutoExpireTimeInMs in interface CacheautoExpireTimeInMs - The auto expiry time in millisecondsCopyright © 2010–2014 Arcbees. All rights reserved.