1 package org.apache.slide.projector.store; 2 3 import java.io.IOException ; 4 import java.util.HashMap ; 5 import java.util.Map ; 6 7 public class Cache extends AbstractStore { 8 private static Cache cache = new Cache(); 9 private Map map; 10 11 public static Cache getInstance() { 12 return cache; 13 } 14 15 public Cache() { 16 map = new HashMap (); 17 } 18 19 public void setMap(Map map) { 20 this.map = map; 21 } 22 23 public Map getMap() { 24 return map; 25 } 26 27 public void put(String key, Object value) throws IOException { 28 map.put(key, value); 29 } 30 31 public Object get(String key) throws IOException { 32 return map.get(key); 33 } 34 35 public void dispose(String key) throws IOException { 36 map.remove(key); 37 } 38 } | Popular Tags |