| Constructor and Description |
|---|
ExpirationCache(int maxSize,
long defaultExpirationTime)
Construct a new expiration cache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key)
Deprecated.
|
int |
getMaxCacheSize()
Return the maximum cache Size.
|
boolean |
isEmpty() |
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(Map<? extends K,? extends V> m) |
V |
remove(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() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllpublic 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(Object key)
Cachenull.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(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>