1 |
pjm2 |
1.1 |
import java.util.HashMap; |
2 |
|
|
|
3 |
|
|
// Paul Mutton, pjm2@ukc.ac.uk |
4 |
|
|
|
5 |
|
|
// Object in which to store incoming XML data |
6 |
|
|
// to be passed around the CORBA system. |
7 |
|
|
public class XMLPacket { |
8 |
|
|
|
9 |
|
|
// Add a key and value pair to the HashMap. |
10 |
|
|
public void addParam(String key, String value){ |
11 |
|
|
params.put(key, value); |
12 |
pjm2 |
1.2 |
|
13 |
|
|
// debug by println ;-) |
14 |
|
|
// System.out.println("Adding to hash: " + key + " = " + value); |
15 |
|
|
// end debug code |
16 |
pjm2 |
1.1 |
} |
17 |
|
|
|
18 |
|
|
// Return the value associated with a particular key. |
19 |
|
|
// Returns null if the key does not exist, although |
20 |
|
|
// this should not necessarily indicate that the key |
21 |
|
|
// does not exist. |
22 |
|
|
public String getParam(String key){ |
23 |
|
|
return (String)params.get(key); |
24 |
|
|
} |
25 |
|
|
|
26 |
|
|
private HashMap params = new HashMap(); |
27 |
|
|
|
28 |
|
|
} |