public class CacheLRU<K,V> extends Object implements Cache<K,V>
| Constructor and Description |
|---|
CacheLRU(float loadFactor,
int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(K key)
Does the cache contain the key?
|
V |
get(K key)
Get from cache - or return null.
|
boolean |
isEmpty() |
Iterator<K> |
keys()
Iterate over all keys.
|
V |
put(K key,
V thing)
Insert into from cache and return old value (or null if none)
|
boolean |
remove(K key)
Remove from cache - return true if key referenced an entry
|
void |
setDropHandler(ActionKeyValue<K,V> dropHandler)
Callback for entries when dropped from the cache
|
long |
size()
Current size of cache
|
public boolean containsKey(K key)
CachecontainsKey in interface Cache<K,V>public V get(K key)
Cachepublic V put(K key, V thing)
Cachepublic boolean remove(K key)
Cachepublic long size()
Cachepublic Iterator<K> keys()
Cachepublic void setDropHandler(ActionKeyValue<K,V> dropHandler)
setDropHandler in interface Cache<K,V>Licenced under the Apache License, Version 2.0