|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache
Cache Interface.
Method Summary | |
---|---|
void |
clear()
Removes all mappings from this map (optional operation). |
boolean |
containsKey(java.lang.Object key)
Checks if a given key exists in the cache. |
java.lang.Object |
get(java.lang.Object key)
Returns an object with a given key from the cache. |
java.util.Set |
keySet()
Returns a set view of the keys contained in this cache. |
void |
put(java.lang.Object key,
java.lang.Object value)
Puts an object with a key into the cache. |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from this cache if present (optional operation). |
int |
size()
Returns the number of elements in this cache (its cardinality). |
java.util.Collection |
values()
Returns a collection view of the values contained in this cache. |
Method Detail |
---|
java.lang.Object get(java.lang.Object key)
key
- the key
void put(java.lang.Object key, java.lang.Object value)
key
- the keyvalue
- the objectboolean containsKey(java.lang.Object key)
key
- the key
true
if the given key exists in the cache, else
false
int size()
java.lang.Object remove(java.lang.Object key)
This implementation iterates over entrySet() searching for an entry with the specified key. If such an entry is found, its value is obtained with its getValue operation, the entry is removed from the Collection (and the backing cache) with the iterator's remove operation, and the saved value is returned. If the iteration terminates without finding such an entry, null is returned. Note that this implementation requires linear time in the size of the cache; many implementations will override this method.
key
- key whose mapping is to be removed from the cache.
void clear()
java.util.Set keySet()
java.util.Collection values()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |