|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Cache<K,V>
This class contains a minimal set of methods required to manipulate a cache of key+value pairs.
| Method Summary | |
|---|---|
boolean |
containsKey(K key)
Returns true if the key (and therefor a corresponding value) is present in the cache or false otherwise. |
Set<K> |
getKeys()
Returns the set of all keys currently in the cache at the time this method was called. |
int |
getSize()
Returns the number of key-value pairs in the cache. |
V |
getValue(K key)
Returns the cached value that is mapped to this key or null if the value is not in the cache. |
V |
putValueIfAbsent(K key,
V value)
Puts the cached key-value pair into the cache if the key does not already exist in the cache. |
V |
removeValue(K key)
Removes an entry from the cache. |
| Method Detail |
|---|
boolean containsKey(K key)
key - The key that the value is mapped to.Set<K> getKeys()
int getSize()
V getValue(K key)
key - The key that the value is mapped to.
V putValueIfAbsent(K key,
V value)
key - The key that the value is mapped to.value - The value to be cached.V removeValue(K key)
key - The key that the value is mapped to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||