01: /*
02: * @(#)Cache.java 1.2 04/12/06
03: *
04: * Copyright (c) 1997-2003 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package org.pnuts.util;
10:
11: /**
12: * Common interface for cache
13: */
14: public interface Cache {
15:
16: /**
17: * If key is in the cache it returns value, otherwise null.
18: *
19: * @param key
20: * the key
21: */
22: public Object get(Object key);
23:
24: /**
25: * Register key and its value into the cache.
26: *
27: * @param key
28: * the key
29: * @param value
30: * the value for the key
31: * @return the old value
32: */
33: public Object put(Object key, Object value);
34:
35: /**
36: * Clear all cached data
37: */
38: public void reset();
39: }
|