1 17 package org.apache.excalibur.store.impl; 18 19 import java.util.Enumeration ; 20 import java.util.Hashtable ; 21 22 import org.apache.avalon.framework.logger.AbstractLogEnabled; 23 import org.apache.avalon.framework.thread.ThreadSafe; 24 import org.apache.excalibur.store.Store; 25 26 36 public class MemoryStore 37 extends AbstractLogEnabled 38 implements Store, ThreadSafe { 39 40 45 46 47 protected Hashtable m_table = new Hashtable (); 48 49 52 public Object get(Object key) 53 { 54 return m_table.get(key); 55 } 56 57 62 public void store(Object key, Object value) 63 { 64 m_table.put(key,value); 65 } 66 67 70 public void remove(Object key) 71 { 72 m_table.remove(key); 73 } 74 75 78 public void clear() 79 { 80 m_table.clear(); 81 } 82 83 public void free() {} 84 85 88 public boolean containsKey(Object key) 89 { 90 return m_table.containsKey(key); 91 } 92 93 96 public Enumeration keys() 97 { 98 return m_table.keys(); 99 } 100 101 105 public int size() 106 { 107 return m_table.size(); 108 } 109 } 110 | Popular Tags |