--- projects/cms/source/util/uk/org/iscream/cms/util/XMLPacket.java 2000/11/30 02:04:18 1.4 +++ projects/cms/source/util/uk/org/iscream/cms/util/XMLPacket.java 2000/12/05 12:26:22 1.7 @@ -1,15 +1,15 @@ //---PACKAGE DECLARATION--- -package uk.ac.ukc.iscream.xml; +package uk.ac.ukc.iscream.util; //---IMPORTS--- -import java.util.HashMap; +import java.util.*; /** * Object in which to store incoming XML data * to be passed around the CORBA system. * - * @author $Author: tdb $ - * @version $Id: XMLPacket.java,v 1.4 2000/11/30 02:04:18 tdb Exp $ + * @author $Author: pjm2 $ + * @version $Id: XMLPacket.java,v 1.7 2000/12/05 12:26:22 pjm2 Exp $ */ public class XMLPacket { @@ -18,7 +18,7 @@ public class XMLPacket { /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.4 $"; + public final String REVISION = "$Revision: 1.7 $"; //---STATIC METHODS--- @@ -28,10 +28,7 @@ public class XMLPacket { // Add a key and value pair to the HashMap. 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 + _params.put(key, value); } // Return the value associated with a particular key. @@ -42,6 +39,11 @@ public class XMLPacket { return (String) _params.get(key); } + // Return a Set of the keys in the HashMap. + public synchronized Set getSet () { + return _params.keySet(); + } + // Print out the entire HashMap. // (Mainly for assisting debugging.) public synchronized String printAll () { @@ -54,7 +56,7 @@ public class XMLPacket { * * @return the name of this class and its CVS revision */ - public String toString() { + public String toString () { return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")"; } @@ -68,4 +70,4 @@ public class XMLPacket { //---STATIC ATTRIBUTES--- -} \ No newline at end of file +}