Constructor and Description |
---|
CacheSimple(int size) |
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)
Cache
containsKey
in interface Cache<K,V>
public V get(K key)
Cache
public V put(K key, V thing)
Cache
public boolean remove(K key)
Cache
public long size()
Cache
public Iterator<K> keys()
Cache
public void setDropHandler(ActionKeyValue<K,V> dropHandler)
setDropHandler
in interface Cache<K,V>
Licenced under the Apache License, Version 2.0