| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaffa.cache.WeakCache
This implementation of the ICache interface uses the WeakHashMap for caching. Note that this implementation is not synchronized. If multiple threads access this cache concurrently, and at least one of the threads modifies the cache structurally, it must be synchronized externally.
| Constructor Summary | |
| WeakCache()Creates a new instance of SimpleCache | |
| Method Summary | |
|  void | clear()Removes all mappings from this cache. | 
|  boolean | containsKey(Object key)Returns true if this cache contains a mapping for the specified key. | 
|  Object | get(Object key)Returns the value to which cache maps the specified key. | 
|  boolean | isEmpty()Returns true if this cache contains no key-value mappings. | 
|  Set | keySet()Returns a set view of the keys contained in this cache. | 
|  void | put(Object key,
       Object value)Associates the specified value with the specified key in this cache. | 
|  void | remove(Object key)Removes the mapping for this key from this cache if it is present. | 
|  int | size()Returns the number of key-value mappings in this cache. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public WeakCache()
| Method Detail | 
public void clear()
clear in interface ICachepublic boolean containsKey(Object key)
containsKey in interface ICachekey - key whose presence in this cache is to be tested.
public Object get(Object key)
get in interface ICachekey - key whose associated value is to be returned.
public boolean isEmpty()
isEmpty in interface ICachepublic Set keySet()
keySet in interface ICache
public void put(Object key,
                Object value)
put in interface ICachekey - key with which the specified value is to be associated.value - value to be associated with the specified key.public void remove(Object key)
remove in interface ICachekey - key whose mapping is to be removed from the cache.public int size()
size in interface ICache| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||