// (c): Matti J. Katila package org.fenfire.util.lava; import java.util.*; /** Very simple util to save integer in map. */ public class CoordsysCache { static public boolean dbg = false; private void p(String s) { System.out.println("CoordsysCache:"+this+": "+s); } private Map coords = new HashMap(); public void clear() { coords.clear(); } public void set(Object key, int cs) { if (dbg) p("set by: "+key+", "+key.hashCode()+", cs: "+cs); coords.put(key, new Integer(cs)); } public int get(Object key) { if (dbg) p("Asked by: "+key+", "+key.hashCode()); return ((Integer)coords.get(key)).intValue(); } }