KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > rolap > cache > HardSmartCache


1 /*
2 // This software is subject to the terms of the Common Public License
3 // Agreement, available at the following URL:
4 // http://www.opensource.org/licenses/cpl.html.
5 // Copyright (C) 2004-2005 TONBELLER AG
6 // All Rights Reserved.
7 // You must accept the terms of that agreement to use this software.
8 */

9 package mondrian.rolap.cache;
10
11 import java.util.HashMap JavaDoc;
12 import java.util.Map JavaDoc;
13
14 /**
15  * An implementation of {@link SmartCache} that uses hard
16  * references. Used for testing.
17  *
18  * @version $Id: //open/mondrian/src/main/mondrian/rolap/cache/HardSmartCache.java#4 $
19  */

20 public class HardSmartCache <K, V> implements SmartCache <K, V> {
21     Map JavaDoc<K, V> cache = new HashMap JavaDoc<K, V>();
22
23     public V put(K key, V value) {
24         return cache.put(key, value);
25     }
26
27     public V get(K key) {
28         return cache.get(key);
29     }
30
31     public void clear() {
32         cache.clear();
33     }
34
35     public int size() {
36         return cache.size();
37     }
38
39 }
40
41 // End HardSmartCache.java
42
Popular Tags