1 2 package com.knowgate.cache; 3 4 import java.util.Hashtable ; 5 6 15 public class AttributedExpireableCache extends ExpireableCache { 16 17 protected Hashtable attributes; 18 19 public AttributedExpireableCache(int capacity, float expire_factor) { 20 super(capacity); 21 attributes=new Hashtable (capacity); 22 } 23 24 public AttributedExpireableCache(int capacity) { 25 super(capacity); 26 attributes=new Hashtable (capacity); 27 } 28 29 public synchronized void put(Object id, Object object, Object attribs) { 30 attributes.put(id,attribs); 31 super.put(id,object); 32 } 33 34 public Object getAttributes(Object key) { 35 return attributes.get(key); 36 } 37 38 public synchronized void remove(Object key) { 39 attributes.remove(key); 40 super.remove(key); 41 } 42 } | Popular Tags |