public interface Cache<Key,Value>
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Key key)
Does the cache contain the key?
|
Value |
get(Key key)
Get from cache - or return null.
|
boolean |
isEmpty() |
Iterator<Key> |
keys()
Iterate over all keys.
|
Value |
put(Key key,
Value 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,Value> dropHandler)
Register a callback - called when an object is dropped from the cache (optional operation)
|
long |
size()
Current size of cache
|
boolean containsKey(Key key)
Value get(Key key)
boolean remove(Key key)
Iterator<Key> keys()
boolean isEmpty()
void clear()
long size()
void setDropHandler(ActionKeyValue<Key,Value> dropHandler)
Licenced under the Apache License, Version 2.0