| org.jaffa.cache.ICache
All known Subclasses: org.jaffa.cache.WeakCache, org.jaffa.cache.SimpleCache,
ICache | public interface ICache (Code) | | This is the interface for the various cache implementations.
author: GautamJ |
Method Summary | |
public void | clear() Removes all mappings from this cache. | public boolean | containsKey(Object key) Returns true if this cache contains a mapping for the specified key.
Parameters: key - key whose presence in this cache is to be tested. | public Object | get(Object key) Returns the value to which cache maps the specified key. | public boolean | isEmpty() Returns true if this cache contains no key-value mappings. | public Set | keySet() Returns a set view of the keys contained in this cache. | public void | put(Object key, Object value) Associates the specified value with the specified key in this cache. | public void | remove(Object key) Removes the mapping for this key from this cache if it is present. | public int | size() Returns the number of key-value mappings in this cache. |
clear | public void clear()(Code) | | Removes all mappings from this cache.
|
containsKey | public boolean containsKey(Object key)(Code) | | Returns true if this cache contains a mapping for the specified key.
Parameters: key - key whose presence in this cache is to be tested. true if this cache contains a mapping for the specified key. |
get | public Object get(Object key)(Code) | | Returns the value to which cache maps the specified key. Returns null if the cache contains no mapping for this key. A return value of null does not necessarily indicate that the cache contains no mapping for the key; it's also possible that the cache explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.
Parameters: key - key whose associated value is to be returned. the value to which this cache maps the specified key, or null if the cache contains no mapping for this key. |
isEmpty | public boolean isEmpty()(Code) | | Returns true if this cache contains no key-value mappings.
true if this cache contains no key-value mappings. |
keySet | public Set keySet()(Code) | | Returns a set view of the keys contained in this cache. The set is backed by the cache, so changes to the cache are reflected in the set, and vice-versa. If the cache is modified while an iteration over the set is in progress, the results of the iteration are undefined.
a set view of the keys contained in this cache. |
put | public void put(Object key, Object value)(Code) | | Associates the specified value with the specified key in this cache. If the cache previously contained a mapping for this key, the old value is replaced by the specified value.
Parameters: key - key with which the specified value is to be associated. Parameters: value - value to be associated with the specified key. |
remove | public void remove(Object key)(Code) | | Removes the mapping for this key from this cache if it is present.
Parameters: key - key whose mapping is to be removed from the cache. |
size | public int size()(Code) | | Returns the number of key-value mappings in this cache.
the number of key-value mappings in this cache. |
|
|