ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/XMLReader/XMLPacket.java
(Generate patch)

Comparing experimental/server/XMLReader/XMLPacket.java (file contents):
Revision 1.2 by pjm2, Tue Nov 14 10:04:01 2000 UTC vs.
Revision 1.3 by pjm2, Tue Nov 14 12:01:19 2000 UTC

# Line 7 | Line 7 | import java.util.HashMap;
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 <        
10 >    public synchronized void addParam (String key, String value) {
11 >        params.put(key, value);        
12          // debug by println ;-)
13          // System.out.println("Adding to hash: " + key + " = " + value);
14          // end debug code
# Line 19 | Line 18 | public class XMLPacket {
18      // Returns null if the key does not exist, although
19      // this should not necessarily indicate that the key
20      // does not exist.
21 <    public String getParam(String key){
21 >    public synchronized String getParam (String key) {
22          return (String)params.get(key);
23 +    }
24 +    
25 +    // Print out the entire HashMap.
26 +    // (Mainly for assisting debugging.)
27 +    public synchronized void printAll () {
28 +        System.out.println(params);
29      }
30  
31      private HashMap params = new HashMap();  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines