/Users/lyon/j4p/src/gui/dialogs/CustomerData.java

1    package gui.dialogs; 
2     
3    import gui.run.ObservableString; 
4     
5    /** 
6     * This class is a simple data structure for holding Customer data. 
7     */ 
8    public class CustomerData { 
9     
10       private ObservableString customerCode = new ObservableString(); 
11       private ObservableString name = new ObservableString(); 
12       private ObservableString address = new ObservableString(); 
13       private ObservableString city = new ObservableString(); 
14       private ObservableString state = new ObservableString(); 
15       private ObservableString zip = new ObservableString(); 
16       private ObservableString country = new ObservableString(); 
17       private ObservableString contact = new ObservableString(); 
18       private ObservableString phone1 = new ObservableString(); 
19       private ObservableString fax = new ObservableString(); 
20       private ObservableString email = new ObservableString(); 
21    
22       public void printData() { 
23           System.out.println(this); 
24       } 
25    
26       public String toString() { 
27           StringBuffer sb = new StringBuffer(); 
28           sb.append("Customer Code: " + getCustomerCode()); 
29           sb.append("\nName         : " + getName()); 
30           sb.append("\nAddress      : " + getAddress()); 
31           sb.append("\nCity         : " + getCity()); 
32           sb.append("\nState        : " + getState()); 
33           sb.append("\nPostcode     : " + getZip()); 
34           sb.append("\nCountry      : " + getCountry()); 
35           sb.append("\nContact      : " + getContact()); 
36           sb.append("\nPhone        : " + getPhone1()); 
37           sb.append("\nFax          : " + getFax()); 
38           sb.append("\nEmail        : " + getEmail()); 
39           return sb.toString(); 
40       } 
41    
42       public String getCustomerCode() { 
43           return customerCode.getValue(); 
44       } 
45    
46       public void setCustomerCode(String customerCode) { 
47           this.customerCode.setValue(customerCode); 
48       } 
49    
50       public String getName() { 
51           return name.getValue(); 
52       } 
53    
54       public void setName(String name) { 
55           this.name.setValue(name); 
56       } 
57    
58       public String getAddress() { 
59           return address.getValue(); 
60       } 
61    
62       public void setAddress(String address) { 
63           this.address.setValue(address); 
64       } 
65    
66       public String getCity() { 
67           return city.getValue(); 
68       } 
69    
70       public void setCity(String city) { 
71           this.city.setValue(city); 
72       } 
73    
74       public String getState() { 
75           return state.getValue(); 
76       } 
77    
78       public void setState(String state) { 
79           this.state.setValue(state); 
80       } 
81    
82       public String getZip() { 
83           return zip.getValue(); 
84       } 
85    
86       public void setZip(String zip) { 
87           this.zip.setValue(zip); 
88       } 
89    
90       public String getCountry() { 
91           return country.getValue(); 
92       } 
93    
94       public void setCountry(String country) { 
95           this.country.setValue(country); 
96       } 
97    
98       public String getContact() { 
99           return contact.getValue(); 
100      } 
101   
102      public void setContact(String contact) { 
103          this.contact.setValue(contact); 
104      } 
105   
106      public String getPhone1() { 
107          return phone1.getValue(); 
108      } 
109   
110      public void setPhone1(String phone1) { 
111          this.phone1.setValue(phone1); 
112      } 
113   
114      public String getFax() { 
115          return fax.getValue(); 
116      } 
117   
118      public void setFax(String fax) { 
119          this.fax.setValue(fax); 
120      } 
121   
122      public String getEmail() { 
123          return email.getValue(); 
124      } 
125   
126      public void setEmail(String email) { 
127          this.email.setValue(email); 
128      } 
129  } 
130