--- experimental/server/XMLReader/XMLPacket.java 2000/11/14 10:04:01 1.2 +++ experimental/server/XMLReader/XMLPacket.java 2000/11/14 12:01:19 1.3 @@ -7,9 +7,8 @@ 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 @@ -19,8 +18,14 @@ public class XMLPacket { // 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();