public class CacheWrapper<Key,T> extends Object implements Cache<Key,T>
| Constructor and Description |
|---|
CacheWrapper(Cache<Key,T> cache) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Key key)
Does the cache contain the key?
|
T |
get(Key key)
Get from cache - or return null.
|
boolean |
isEmpty() |
Iterator<Key> |
keys()
Iterate over all keys.
|
T |
put(Key key,
T thing)
Insert into from cache and return old value (or null if none)
|
boolean |
remove(Key key)
Remove from cache - return true if key referenced an entry
|
void |
setDropHandler(ActionKeyValue<Key,T> dropHandler)
Register a callback - called when an object is dropped from the cache (optional operation)
|
long |
size()
Current size of cache
|
public boolean containsKey(Key key)
CachecontainsKey in interface Cache<Key,T>public T get(Key key)
Cachepublic Iterator<Key> keys()
Cachepublic T put(Key key, T thing)
Cachepublic boolean remove(Key key)
Cachepublic void setDropHandler(ActionKeyValue<Key,T> dropHandler)
CachesetDropHandler in interface Cache<Key,T>Licenced under the Apache License, Version 2.0