public interface Cache<K,V>
Modifier and Type | Method and Description |
---|---|
V |
get(K key)
Retrieve a value, given its key.
|
java.lang.Object |
put(K key,
V value)
Add an entry to the cache, identified by the given key.
|
java.lang.Object |
remove(K key)
Remove the entry associated with the given key from the cache.
|
V get(K key)
key
- A hashable key.null
if there is no mapping
for the given key.java.lang.Object put(K key, V value)
key
- A hashable key to associate with the value.value
- Value to store.null
if there was no
mapping for the given key.java.lang.Object remove(K key)
key
- A hashable key identifying the entry to remove.null
if there was no mapping for the given key.