1 16 package com.jdon.controller.cache; 17 18 import java.util.HashMap ; 19 import java.util.Map ; 20 21 import com.jdon.container.pico.Startable; 22 import com.jdon.util.Debug; 23 24 30 public class InstanceCache implements Startable{ 31 public final static String NAME = "InstanceCache"; 32 33 private Map pool = new HashMap (); 34 35 public void start(){ 36 37 } 38 39 public void stop(){ 40 pool.clear(); 41 } 42 43 46 public Object get(Object key) { 47 return pool.get(key); 48 } 49 50 53 public void put(Object key, Object value) { 54 pool.put(key, value); 55 } 56 57 60 public void remove(Object key) { 61 pool.remove(key); 62 } 63 64 67 public long size() { 68 return pool.size(); 69 } 70 71 74 public void clear() { 75 pool.clear(); 76 } 77 78 81 public boolean contain(Object key) { 82 return pool.containsKey(key); 83 } 84 85 } 86 | Popular Tags |