1 17 18 package com.whirlycott.cache.impl; 19 20 import java.util.Collection ; 21 import java.util.Map ; 22 import java.util.Set ; 23 24 import com.whirlycott.cache.ManagedCache; 25 26 32 public abstract class AbstractMapBackedCache implements ManagedCache { 33 34 35 protected Map c; 36 37 public void destroy() { 38 c.clear(); 39 c = null; 40 } 41 42 public abstract void setMostlyRead(final boolean _mostlyRead); 43 44 public int size() { 45 return c.size(); 46 } 47 48 public void clear() { 49 c.clear(); 50 } 51 52 public boolean isEmpty() { 53 return c.isEmpty(); 54 } 55 56 public boolean containsKey(final Object key) { 57 return c.containsKey(key); 58 } 59 60 public boolean containsValue(final Object value) { 61 return c.containsValue(value); 62 } 63 64 public Collection values() { 65 return c.values(); 66 } 67 68 public void putAll(final Map t) { 69 c.putAll(t); 70 } 71 72 public Set entrySet() { 73 return c.entrySet(); 74 } 75 76 public Set keySet() { 77 return c.keySet(); 78 } 79 80 public Object get(final Object key) { 81 return c.get(key); 82 } 83 84 public Object remove(final Object key) { 85 return c.remove(key); 86 } 87 88 public Object put(final Object key, final Object value) { 89 return c.put(key, value); 90 } 91 92 public void store(final Object key, final Object value) { 93 c.put(key, value); 94 } 95 96 public Object retrieve(final Object key) { 97 return c.get(key); 98 } 99 100 } 101 | Popular Tags |