KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > field > TKOptionFieldEntry


1 package com.teamkonzept.field;
2
3 /**
4  * The option field entry.
5  *
6  * @author $Author: uli $
7  * @version $Revision: 1.11 $
8  */

9 public class TKOptionFieldEntry
10 {
11     // $Id: TKOptionFieldEntry.java,v 1.11 2002/02/27 11:07:04 uli Exp $
12

13     public final static String JavaDoc OPTION_KEY = "OPTION";
14     public final static String JavaDoc VALUE_KEY = "VALUE";
15
16     /**
17      * The selected option.
18      */

19     public String JavaDoc option = null;
20
21     /**
22      * The option value.
23      */

24     public String JavaDoc value;
25
26     public TKOptionFieldEntry (String JavaDoc option, String JavaDoc value)
27     {
28         this.option = option;
29         this.value = value;
30     }
31
32     /**
33      * Checks wether this object and the specified object
34      * may be treated as equal.
35      *
36      * @param object the object to checked for equality.
37      * @return <CODE>true</CODE> if this object and the
38      * specified object may be treated as equal, otherwise
39      * <CODE>false</CODE>.
40      */

41     public boolean equals (Object JavaDoc object)
42     {
43         if (object == null)
44         {
45             return false;
46         }
47
48         if (object == this)
49         {
50             return true;
51         }
52
53         if (! this.getClass().equals(object.getClass()))
54         {
55             return false;
56         }
57
58         TKOptionFieldEntry field = (TKOptionFieldEntry) object;
59
60         return (this.option == null ? field.option == null : this.option.equals(field.option)) &&
61                (this.value == null ? field.value == null : this.value.equals(field.value));
62     }
63
64     /**
65      * Returns the hash code for this object.
66      *
67      * @return the hash code for this object.
68      */

69     public int hashCode ()
70     {
71         // Implementation for JTest only ;-(
72
return super.hashCode();
73     }
74
75 }
76
Popular Tags