| Constructor and Description |
|---|
ExpirationCache(int maxSize,
long defaultExpirationTime)
Construct a new expiration cache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key)
Deprecated.
|
int |
getMaxCacheSize()
Return the maximum cache Size.
|
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
V |
lookup(K key)
Returns the value of the specified key, or
null. |
V |
put(K key,
V value)
Put a value in the cache.
|
V |
put(K key,
V value,
long expirationTime)
Put a value in the cahce with the specified expiration time in milliseconds.
|
void |
putAll(java.util.Map<? extends K,? extends V> m) |
V |
remove(java.lang.Object key)
Remove a entry with the given key from the cache.
|
void |
setDefaultExpirationTime(long defaultExpirationTime)
Set the default expiration time in milliseconds.
|
void |
setMaxCacheSize(int maxCacheSize)
Set the maximum cache size.
|
int |
size() |
java.util.Collection<V> |
values() |
public ExpirationCache(int maxSize,
long defaultExpirationTime)
maxSize - the maximum size.defaultExpirationTime - the default expiration time in milliseconds.public void setDefaultExpirationTime(long defaultExpirationTime)
defaultExpirationTime - the default expiration time.public V put(K key, V value, long expirationTime)
key - the key of the value.value - the value.expirationTime - the expiration time in milliseconds.null.public V lookup(K key)
Cachenull.@Deprecated public V get(java.lang.Object key)
Cachenull.public V remove(java.lang.Object key)
public int getMaxCacheSize()
CachegetMaxCacheSize in interface Cache<K,V>public void setMaxCacheSize(int maxCacheSize)
CachesetMaxCacheSize in interface Cache<K,V>maxCacheSize - the new maximum cache size.public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)