|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
K - the type of keysV - the type of mapped valuespublic interface Cache<K,V>
A Map-like data structure that stores key-value pairs and provides temporary access to it.
| Method Summary | |
|---|---|
void |
clear()
Clears the contents of the cache. |
V |
get(K key)
Gets an entry from the cache. |
boolean |
isEmpty()
Returns true if this cache contains no key-value mappings. |
Set<K> |
keySet()
Returns a Set view of the keys contained in this cache. |
void |
put(K key,
V value)
Associates the specified value with the specified key in the cache. |
void |
remove(K key)
Removes an entry from the cache. |
int |
size()
|
| Method Detail |
|---|
V get(K key)
key - the key whose associated value is to be returned
null, if it does not exist.
void put(K key,
V value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified key
NullPointerException - if key is null or if value is nullvoid clear()
void remove(K key)
key - key with which the specified value is to be associated.Set<K> keySet()
int size()
boolean isEmpty()
true if this cache contains no key-value mappings.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||