KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > swingclient > NameValueStringMap


1 package org.enhydra.shark.swingclient;
2
3 /**
4 * The class that holds the strings representing some property,
5 * and it's value.
6 */

7 public class NameValueStringMap {
8    public String JavaDoc name;
9    public String JavaDoc value;
10
11    public NameValueStringMap (String JavaDoc name,String JavaDoc value) {
12       this.name=name;
13       this.value=value;
14    }
15
16    public boolean equals (Object JavaDoc obj) {
17       if (obj instanceof NameValueStringMap) {
18          NameValueStringMap nvsm=(NameValueStringMap)obj;
19          if (nvsm==null) return false;
20          return (name.equals(nvsm.name) &&
21             value.equals(nvsm.value));
22       }
23       return false;
24    }
25
26    public String JavaDoc toString () {
27       return "["+name+","+value+"]";
28    }
29 }
30
Popular Tags