--- projects/cms/source/util/uk/org/iscream/cms/util/XMLPacket.java 2000/12/12 20:44:30 1.9 +++ projects/cms/source/util/uk/org/iscream/cms/util/XMLPacket.java 2004/08/01 10:41:08 1.16 @@ -1,15 +1,35 @@ +/* + * i-scream central monitoring system + * http://www.i-scream.org + * Copyright (C) 2000-2002 i-scream + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + //---PACKAGE DECLARATION--- -package uk.ac.ukc.iscream.util; +package uk.org.iscream.cms.util; //---IMPORTS--- import java.util.*; /** - * Object in which to store incoming XML data - * to be passed around the CORBA system. + * Object in which to store incoming XML data for processing + * by a component of the system. * - * @author $Author: ajm $ - * @version $Id: XMLPacket.java,v 1.9 2000/12/12 20:44:30 ajm Exp $ + * @author $Author: tdb $ + * @version $Id: XMLPacket.java,v 1.16 2004/08/01 10:41:08 tdb Exp $ */ public class XMLPacket { @@ -18,7 +38,7 @@ public class XMLPacket { /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.9 $"; + public final String REVISION = "$Revision: 1.16 $"; //---STATIC METHODS--- @@ -28,6 +48,9 @@ public class XMLPacket { /** * Add a key and value pair to the HashMap. + * + * @param key The key value + * @param value The value associated with the key */ public synchronized void addParam (String key, String value) { _params.put(key, value); @@ -38,6 +61,9 @@ public class XMLPacket { * Returns null if the key does not exist, although * this should not necessarily indicate that the key * does not exist. + * + * @param key The key to retrieve + * @return The value associated with the key, if one exists, otherwise null. */ public synchronized String getParam (String key) { return (String) _params.get(key); @@ -45,6 +71,8 @@ public class XMLPacket { /** * Return a Set of the keys in the HashMap. + * + * @return a Set of the values in this Packet. */ public synchronized Set getSet () { return _params.keySet(); @@ -52,6 +80,9 @@ public class XMLPacket { /** * Find if a particular key exists in the HashMap. + * + * @param key The key to check for + * @return whether the key exists */ public synchronized boolean containsKey(String key){ return _params.containsKey(key); @@ -60,6 +91,8 @@ public class XMLPacket { /** * Print out the entire HashMap. * (Mainly for assisting debugging.) + * + * @return A String representation of the data in this Packet */ public synchronized String printAll () { return _params.toString(); @@ -69,7 +102,7 @@ public class XMLPacket { * Overrides the {@link java.lang.Object#toString() Object.toString()} * method to provide clean logging (every class should have this). * - * This uses the uk.ac.ukc.iscream.util.NameFormat class + * This uses the uk.org.iscream.cms.server.util.NameFormat class * to format the toString() * * @return the name of this class and its CVS revision @@ -87,6 +120,9 @@ public class XMLPacket { //---ATTRIBUTES--- + /** + * A HashMap of parameters + */ private HashMap _params = new HashMap(); /**