KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > test > Address


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.test;
8
9
10 /**
11  * <p>
12  * This class is a test javabean that represents an address
13  * </p>
14  *
15  * @author Brian Pontarelli
16  * @since 2.0
17  * @version 2.0
18  */

19 public class Address {
20
21     private String JavaDoc [] countries = {"Select a country", "USA", "Canada"};
22     private String JavaDoc [] cities;
23     private String JavaDoc address1;
24     private String JavaDoc address2;
25     private String JavaDoc country;
26     private String JavaDoc city;
27     private String JavaDoc state;
28     private String JavaDoc zipcode;
29
30
31     /**
32      * Constructor for Address.
33      */

34     public Address() {
35         super();
36     }
37
38
39     /**
40      * @return
41      */

42     public String JavaDoc[] getCountries() {
43         return countries;
44     }
45
46     /**
47      * @param strings
48      */

49     public void setCountries(String JavaDoc[] strings) {
50         countries = strings;
51     }
52
53     /**
54      * @return
55      */

56     public String JavaDoc[] getCities() {
57         return cities;
58     }
59
60     /**
61      * @param strings
62      */

63     public void setCities(String JavaDoc[] strings) {
64         cities = strings;
65     }
66
67     /**
68      * Retrieves the address1 property
69      *
70      * @return Returns the address1 property
71      */

72     public String JavaDoc getAddress1() {
73         return address1;
74     }
75
76     /**
77      * Populates the address1 property
78      *
79      * @param address1 The value of the address1 property
80      */

81     public void setAddress1(String JavaDoc address1) {
82         this.address1 = address1;
83     }
84
85     /**
86      * Retrieves the address2 property
87      *
88      * @return Returns the address2 property
89      */

90     public String JavaDoc getAddress2() {
91         return address2;
92     }
93
94     /**
95      * Populates the address2 property
96      *
97      * @param address2 The value of the address2 property
98      */

99     public void setAddress2(String JavaDoc address2) {
100         this.address2 = address2;
101     }
102
103     /**
104      * Retrieves the address' city
105      *
106      * @return Returns the address' city
107      */

108     public String JavaDoc getCity() {
109         return city;
110     }
111
112     /**
113      * Populates the address' city
114      *
115      * @param city The value of the address' city
116      */

117     public void setCity(String JavaDoc city) {
118         this.city = city;
119     }
120
121     /**
122      * Retrieves the address' state
123      *
124      * @return Returns the address' state
125      */

126     public String JavaDoc getState() {
127         return state;
128     }
129
130     /**
131      * Populates the address' state
132      *
133      * @param state The value of the address' state
134      */

135     public void setState(String JavaDoc state) {
136         this.state = state;
137     }
138
139     /**
140      * @return
141      */

142     public String JavaDoc getCountry() {
143         return country;
144     }
145
146     /**
147      * @param string
148      */

149     public void setCountry(String JavaDoc string) {
150         country = string;
151     }
152
153     /**
154      * Retrieves the address' zipcode
155      *
156      * @return Returns the address' zipcode
157      */

158     public String JavaDoc getZipcode() {
159         return zipcode;
160     }
161
162     /**
163      * Populates the address' zipcode
164      *
165      * @param zipcode The value of the address' zipcode
166      */

167     public void setZipcode(String JavaDoc zipcode) {
168         this.zipcode = zipcode;
169     }
170
171     /**
172      * @see java.lang.Object#toString()
173      */

174     public String JavaDoc toString() {
175         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
176         buf.append("address1: ").append(address1).append("\n");
177         buf.append("address2: ").append(address2).append("\n");
178         buf.append("city: ").append(city).append("\n");
179         buf.append("state: ").append(state).append("\n");
180         buf.append("zipcode: ").append(zipcode).append("\n");
181         return buf.toString();
182     }
183 }
Popular Tags