ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/util/uk/org/iscream/cms/util/XMLPacket.java
Revision: 1.5
Committed: Thu Nov 30 02:38:17 2000 UTC (23 years, 5 months ago) by ajm
Branch: MAIN
Changes since 1.4: +3 -3 lines
Log Message:
Changed package structure
uk.ac.ukc.iscream.refman and xml -> uk.ac.ukc.iscream.util

File Contents

# Content
1 //---PACKAGE DECLARATION---
2 package uk.ac.ukc.iscream.util;
3
4 //---IMPORTS---
5 import java.util.HashMap;
6
7 /**
8 * Object in which to store incoming XML data
9 * to be passed around the CORBA system.
10 *
11 * @author $Author: tdb1 $
12 * @version $Id: XMLPacket.java,v 1.4 2000/11/30 02:04:18 tdb1 Exp $
13 */
14 public class XMLPacket {
15
16 //---FINAL ATTRIBUTES---
17
18 /**
19 * The current CVS revision of this class
20 */
21 public final String REVISION = "$Revision: 1.4 $";
22
23 //---STATIC METHODS---
24
25 //---CONSTRUCTORS---
26
27 //---PUBLIC METHODS---
28
29 // Add a key and value pair to the HashMap.
30 public synchronized void addParam (String key, String value) {
31 _params.put(key, value);
32 // debug by println ;-)
33 // System.out.println("Adding to hash: " + key + " = " + value);
34 // end debug code
35 }
36
37 // Return the value associated with a particular key.
38 // Returns null if the key does not exist, although
39 // this should not necessarily indicate that the key
40 // does not exist.
41 public synchronized String getParam (String key) {
42 return (String) _params.get(key);
43 }
44
45 // Print out the entire HashMap.
46 // (Mainly for assisting debugging.)
47 public synchronized String printAll () {
48 return _params.toString();
49 }
50
51 /**
52 * Overrides the {@link java.lang.Object#toString() Object.toString()}
53 * method to provide clean logging (every class should have this).
54 *
55 * @return the name of this class and its CVS revision
56 */
57 public String toString() {
58 return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
59 }
60
61 //---PRIVATE METHODS---
62
63 //---ACCESSOR/MUTATOR METHODS---
64
65 //---ATTRIBUTES---
66
67 private HashMap _params = new HashMap();
68
69 //---STATIC ATTRIBUTES---
70
71 }