KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > shiftone > cache > Cache


1 package org.shiftone.cache;
2
3
4
5 /**
6  * Interface Cache
7  *
8  *
9  * @author <a HREF="mailto:jeff@shiftone.org">Jeff Drost</a>
10  * @version $Revision: 1.8 $
11  */

12 public interface Cache
13 {
14
15     /**
16      * adds an object to the cache
17      */

18     void addObject(Object JavaDoc userKey, Object JavaDoc cacheObject);
19
20
21     /**
22      * gets the value stored in the cache by it's key,
23      * or null if the key is not found.
24      */

25     Object JavaDoc getObject(Object JavaDoc key);
26
27
28     /**
29      * The number of key/value pares in the cache
30      */

31     int size();
32
33
34     /**
35      * remove a specific key/value pair from the cache
36      */

37     void remove(Object JavaDoc key);
38
39
40     /**
41      * Removes ALL keys and values from the cache.
42      * Use with digression. Using this method too frequently
43      * may defeat the purpose of caching.
44      */

45     void clear();
46 }
47
Popular Tags