KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > j2ee > blueprints > consumerwebsite > Address


1 package com.sun.j2ee.blueprints.consumerwebsite;
2
3 public class Address {
4   private String JavaDoc streetName1;
5   private String JavaDoc streetName2;
6   private String JavaDoc city;
7   private String JavaDoc state;
8   private String JavaDoc zipCode;
9   private String JavaDoc country;
10
11   public Address() {}
12
13   public Address(String JavaDoc streetName1, String JavaDoc streetName2, String JavaDoc city,
14                  String JavaDoc state, String JavaDoc zipCode, String JavaDoc country) {
15     this.streetName1 = streetName1;
16     this.streetName2 = streetName2;
17     this.city = city;
18     this.state = state;
19     this.zipCode = zipCode;
20     this.country = country;
21     return;
22   }
23
24   // getter methods
25

26   public String JavaDoc getStreetName1() {
27     return streetName1;
28   }
29
30   public String JavaDoc getStreetName2() {
31     return streetName2;
32   }
33
34   public String JavaDoc getCity() {
35     return city;
36   }
37
38   public String JavaDoc getState() {
39     return state;
40   }
41
42   public String JavaDoc getCountry() {
43     return country;
44   }
45
46   public String JavaDoc getZipCode() {
47     return zipCode;
48   }
49
50   // setter methods
51

52   public void setStreetName1(String JavaDoc streetName) {
53     this.streetName1 = streetName;
54     return;
55   }
56
57   public void setStreetName2(String JavaDoc streetName) {
58     this.streetName2 = streetName;
59     return;
60   }
61
62   public void setCity(String JavaDoc city) {
63     this.city = city;
64     return;
65   }
66
67   public void setState(String JavaDoc state) {
68     this.state = state;
69     return;
70   }
71
72   public void setCountry(String JavaDoc country) {
73     this.country = country;
74     return;
75   }
76
77   public void setZipCode(String JavaDoc zipCode) {
78     this.zipCode = zipCode;
79     return;
80   }
81
82   public String JavaDoc toString() {
83     return "Address[streeName1=" + streetName1 + ", "
84       + "streetName2=" + streetName2 + ", "
85       + "city=" + city + ", "
86       + "state=" + state + ", "
87       + "zipCode=" + zipCode + ", "
88       + "country=" + country + "]";
89   }
90 }
91
92
93
Popular Tags