KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > store > CreditCardType


1 /*
2  * Created on Mar 4, 2004
3  *
4  */

5 package com.openedit.store;
6
7 /**
8  * @author dbrown
9  *
10  */

11 public class CreditCardType implements Comparable JavaDoc
12 {
13     protected String JavaDoc fieldName = "";
14     protected String JavaDoc fieldId = "";
15     
16     public CreditCardType()
17     {
18     }
19
20     public CreditCardType( String JavaDoc inName )
21     {
22         fieldName = inName;
23     }
24
25     public String JavaDoc getName()
26     {
27         if ( fieldName == null )
28         {
29             fieldName = "";
30         }
31         return fieldName;
32     }
33
34     public void setName(String JavaDoc inString)
35     {
36         fieldName = inString;
37     }
38
39     public String JavaDoc toString()
40     {
41         return fieldName;
42     }
43
44     public int compareTo(Object JavaDoc o)
45     {
46         if ( o instanceof CreditCardType )
47         {
48             return getName().compareTo( ((CreditCardType) o).getName() );
49         }
50         else
51         {
52             return -1;
53         }
54     }
55
56     public boolean equals( Object JavaDoc o )
57     {
58         if ( o instanceof CreditCardType )
59         {
60             return getName().equals( ((CreditCardType) o).getName() );
61         }
62         else
63         {
64             return false;
65         }
66     }
67
68     public int hashCode()
69     {
70         return getName().hashCode();
71     }
72     public String JavaDoc getId() {
73         return fieldId;
74     }
75     public void setId(String JavaDoc inId) {
76         fieldId = inId;
77     }
78 }
79
Popular Tags