KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > samples > contacts > Person


1
2 package org.objectweb.jac.samples.contacts;
3
4 import java.util.Date JavaDoc;
5 import java.util.Vector JavaDoc;
6 import java.util.List JavaDoc;
7
8 public class Person {
9     String JavaDoc lastName;
10     String JavaDoc firstName;
11     String JavaDoc phone;
12     String JavaDoc notes;
13     Date JavaDoc lastContact;
14     Date JavaDoc contactAgain;
15
16     public Person() {
17     }
18
19     public Person(String JavaDoc lastName, String JavaDoc firstName, String JavaDoc phone,
20                   String JavaDoc email) {
21         this.lastName = lastName;
22         this.firstName = firstName;
23         this.phone = phone;
24         this.email = email;
25     }
26
27     public String JavaDoc toString() {
28         return (lastName==null?"":lastName)+" "+(firstName==null?"":firstName);
29     }
30    
31     List JavaDoc actions = new Vector JavaDoc();
32
33     /**
34      * Get the value of actions.
35      * @return value of actions.
36      */

37     public List JavaDoc getActions() {
38         return actions;
39     }
40
41     /**
42      * Add an action from actions.
43      * @param action the action added.
44      */

45     public void addAction(Action action) {
46         actions.add(action);
47     }
48
49     /**
50      * Remove an action from actions.
51      * @param action the action removed.
52      */

53     public void removeAction(Action action) {
54         actions.remove(action);
55     }
56
57     /**
58      * Get the value of lastContact.
59      * @return value of lastContact.
60      */

61     public Date JavaDoc getLastContact() {
62         return lastContact;
63     }
64    
65     /**
66      * Set the value of lastContact.
67      * @param v Value to assign to lastContact.
68      */

69     public void setLastContact(Date JavaDoc v) {
70         this.lastContact = v;
71     }
72    
73    
74     /**
75      * Get the value of contactAgain.
76      * @return value of contactAgain.
77      */

78     public Date JavaDoc getContactAgain() {
79         return contactAgain;
80     }
81    
82     /**
83      * Set the value of contactAgain.
84      * @param v Value to assign to contactAgain.
85      */

86     public void setContactAgain(Date JavaDoc v) {
87         this.contactAgain = v;
88     }
89    
90     /**
91      * Get the value of notes.
92      * @return value of notes.
93      */

94     public String JavaDoc getNotes() {
95         return notes;
96     }
97    
98     /**
99      * Set the value of notes.
100      * @param v Value to assign to notes.
101      */

102     public void setNotes(String JavaDoc v) {
103         this.notes = v;
104     }
105    
106     /**
107      * Set the value of lastName.
108      * @param lastName Value to assign to lastName.
109      */

110     public void setLastName( String JavaDoc lastName ) {
111         this.lastName = lastName;
112     }
113    
114     /**
115      * Get the value of lastName.
116      * @return value of lastName.
117      */

118     public String JavaDoc getLastName() {
119         return lastName;
120     }
121    
122     /**
123      * Set the value of firstName.
124      * @param firstName Value to assign to firstName.
125      */

126     public void setFirstName( String JavaDoc firstName ) {
127         this.firstName = firstName;
128     }
129    
130     /**
131      * Get the value of firstName.
132      * @return value of firstName.
133      */

134     public String JavaDoc getFirstName() {
135         return firstName;
136     }
137    
138     /**
139      * Set the value of phone.
140      * @param phone Value to assign to phone.
141      */

142     public void setPhone( String JavaDoc phone ) {
143         this.phone = phone;
144     }
145    
146     /**
147      * Get the value of phone.
148      * @return value of phone.
149      */

150     public String JavaDoc getPhone() {
151         return phone;
152     }
153    
154     String JavaDoc position;
155    
156     /**
157      * Get the value of position.
158      * @return value of position.
159      */

160     public String JavaDoc getPosition() {
161         return position;
162     }
163    
164     /**
165      * Set the value of position.
166      * @param v Value to assign to position.
167      */

168     public void setPosition(String JavaDoc v) {
169         this.position = v;
170     }
171    
172     String JavaDoc email;
173    
174     /**
175      * Get the value of email.
176      * @return value of email.
177      */

178     public String JavaDoc getEmail() {
179         return email;
180     }
181    
182     /**
183      * Set the value of email.
184      * @param v Value to assign to email.
185      */

186     public void setEmail(String JavaDoc v) {
187         this.email = v;
188     }
189    
190
191     Company company;
192    
193     /**
194      * Get the value of company.
195      * @return value of company.
196      */

197     public Company getCompany() {
198         return company;
199     }
200    
201     /**
202      * Set the value of company.
203      * @param v Value to assign to company.
204      */

205     public void setCompany(Company v) {
206         this.company = v;
207     }
208
209     boolean mailing;
210    
211     /**
212      * Get the value of mailing.
213      * @return value of mailing.
214      */

215     public boolean isMailing() {
216         return mailing;
217     }
218    
219     /**
220      * Set the value of mailing.
221      * @param v Value to assign to mailing.
222      */

223     public void setMailing(boolean v) {
224         this.mailing = v;
225     }
226    
227 }
228     
229
Popular Tags