--- experimental/server/XMLReader/XMLPacket.java 2000/11/14 09:48:06 1.1 +++ experimental/server/XMLReader/XMLPacket.java 2000/11/14 12:01:19 1.3 @@ -7,16 +7,25 @@ import java.util.HashMap; public class XMLPacket { // Add a key and value pair to the HashMap. - public void addParam(String key, String value){ - params.put(key, value); + public synchronized void addParam (String key, String value) { + params.put(key, value); + // debug by println ;-) + // System.out.println("Adding to hash: " + key + " = " + value); + // end debug code } // Return the value associated with a particular key. // Returns null if the key does not exist, although // this should not necessarily indicate that the key // does not exist. - public String getParam(String key){ + public synchronized String getParam (String key) { return (String)params.get(key); + } + + // Print out the entire HashMap. + // (Mainly for assisting debugging.) + public synchronized void printAll () { + System.out.println(params); } private HashMap params = new HashMap();