KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > knowgate > cache > AttributedExpireableCache


1
2 package com.knowgate.cache;
3
4 import java.util.Hashtable JavaDoc;
5
6 /**
7  * AttributedExpireableCache.java
8  *
9  *
10  * Created: Tue Apr 25 14:57:22 2000
11  *
12  * @author Sebastian Schaffert
13  * @version
14  */

15 public class AttributedExpireableCache extends ExpireableCache {
16
17     protected Hashtable JavaDoc attributes;
18
19     public AttributedExpireableCache(int capacity, float expire_factor) {
20     super(capacity);
21     attributes=new Hashtable JavaDoc(capacity);
22     }
23
24     public AttributedExpireableCache(int capacity) {
25     super(capacity);
26     attributes=new Hashtable JavaDoc(capacity);
27     }
28
29     public synchronized void put(Object JavaDoc id, Object JavaDoc object, Object JavaDoc attribs) {
30     attributes.put(id,attribs);
31     super.put(id,object);
32     }
33
34     public Object JavaDoc getAttributes(Object JavaDoc key) {
35     return attributes.get(key);
36     }
37
38     public synchronized void remove(Object JavaDoc key) {
39     attributes.remove(key);
40     super.remove(key);
41     }
42 } // AttributedExpireableCache
43
Popular Tags