01: package org.shiftone.cache;
02:
03: /**
04: * Interface Cache
05: *
06: *
07: * @author <a href="mailto:jeff@shiftone.org">Jeff Drost</a>
08: * @version $Revision: 1.8 $
09: */
10: public interface Cache {
11:
12: /**
13: * adds an object to the cache
14: */
15: void addObject(Object userKey, Object cacheObject);
16:
17: /**
18: * gets the value stored in the cache by it's key,
19: * or null if the key is not found.
20: */
21: Object getObject(Object key);
22:
23: /**
24: * The number of key/value pares in the cache
25: */
26: int size();
27:
28: /**
29: * remove a specific key/value pair from the cache
30: */
31: void remove(Object key);
32:
33: /**
34: * Removes ALL keys and values from the cache.
35: * Use with digression. Using this method too frequently
36: * may defeat the purpose of caching.
37: */
38: void clear();
39: }
|