KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > interop3 > groupE > List


1 /*
2  * Copyright 2002-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package test.wsdl.interop3.groupE;
18  
19 /**
20  * Test linked list used by the WSDLInteropTestDocLitService.
21  *
22  * @author Glyn Normington <glyn@apache.org>
23  */

24 public class List {
25
26     // items of the structure. String permits nulls.
27
private int varInt;
28     private String JavaDoc varString;
29     private List child;
30
31     /**
32      * null constructor
33      */

34     public List() {}
35
36     /**
37      * convenience constructor that sets all of the fields
38      */

39     public List(int i, String JavaDoc s, List c) {
40         this.varInt = i;
41         this.varString = s;
42         this.child = c;
43     }
44
45     /**
46      * bean getter for VarInt
47      */

48     public int getVarInt() {
49         return varInt;
50     }
51
52     /**
53      * bean setter for VarInt
54      */

55     public void setVarInt(int varInt) {
56         this.varInt = varInt;
57     }
58
59     /**
60      * bean getter for VarString
61      */

62     public String JavaDoc getVarString() {
63         return varString;
64     }
65
66     /**
67      * bean setter for VarString
68      */

69     public void setVarString(String JavaDoc varString) {
70         this.varString = varString;
71     }
72
73     /**
74      * bean getter for Child
75      */

76     public List getChild() {
77         return child;
78     }
79
80     /**
81      * bean setter for Child
82      */

83     public void setChild(List c) {
84         this.child = c;
85     }
86
87     /**
88      * Equality comparison.
89      */

90     public boolean equals(Object JavaDoc object) {
91         if (!(object instanceof List)) return false;
92
93         List that = (List)object;
94
95         if (this.varInt != that.varInt) return false;
96
97         if (this.varString == null) {
98             if (that.varString != null) return false;
99         } else {
100             if (!this.varString.equals(that.varString)) return false;
101         }
102
103         if (this.child == null) {
104             if (that.child != null) return false;
105         } else {
106             if (!this.child.equals(that.child)) return false;
107         }
108
109         return true;
110     }
111
112     /**
113      * Printable representation
114      */

115     public String JavaDoc toString() {
116         return "{" + varInt + ", \"" + varString + "\", " +
117             (child == null ? null :child.toString()) + "}";
118     }
119 }
120
Popular Tags