1 25 26 29 package net.killingar.forum.internal.caches; 30 31 import net.killingar.forum.internal.IDItem; 32 import net.killingar.forum.internal.NamedItem; 33 34 import java.sql.SQLException ; 35 import java.util.HashMap ; 36 37 public abstract class AbstractNamedItemCache extends AbstractIDItemCache 38 { 39 protected HashMap objectNames = new HashMap (); 40 41 public NamedItem get(String name) throws SQLException 42 { 43 update(); 44 return (NamedItem)objectNames.get(name); 45 } 46 47 public void add(IDItem inO) 48 { 49 addNamed((NamedItem)inO); 50 } 51 52 public void addNamed(NamedItem inO) 53 { 54 objects.put(inO.getId(), inO); 55 objectNames.put(inO.getName(), inO); 56 } 57 } 58 | Popular Tags |