1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.cache.general;
18
19 import java.util.HashMap;
20
21 /***
22 * <p>
23 * SimpleHashMapCache
24 * </p>
25 * <p>
26 *
27 * </p>
28 * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
29 * @version $Id: SimpleHashMapCache.java 516448 2007-03-09 16:25:47Z ate $
30 *
31 */
32 public class SimpleHashMapCache implements GeneralCache
33 {
34
35 protected HashMap cache;
36
37 /***
38 *
39 */
40 public SimpleHashMapCache()
41 {
42 super();
43 cache = new HashMap();
44 }
45
46 /***
47 * <p>
48 * get
49 * </p>
50 *
51 * @see org.apache.jetspeed.cache.general.GeneralCache#get(java.lang.String)
52 * @param key
53 * @return
54 */
55 public Object get( String key )
56 {
57 return cache.get(key);
58 }
59
60 /***
61 * <p>
62 * put
63 * </p>
64 *
65 * @see org.apache.jetspeed.cache.general.GeneralCache#put(java.lang.String, java.lang.Object)
66 * @param key
67 * @param value
68 */
69 public void put( String key, Object value )
70 {
71 cache.put(key, value);
72
73 }
74
75 /***
76 * <p>
77 * contains
78 * </p>
79 *
80 * @see org.apache.jetspeed.cache.general.GeneralCache#contains(java.lang.String)
81 * @param key
82 * @return
83 */
84 public boolean contains( String key )
85 {
86 return cache.containsKey(key);
87 }
88
89 /***
90 * <p>
91 * remove
92 * </p>
93 *
94 * @see org.apache.jetspeed.cache.general.GeneralCache#remove(java.lang.String)
95 * @param key
96 */
97 public Object remove( String key )
98 {
99 return cache.remove(key);
100 }
101
102 }