KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > auction > Name


1 //$Id: Name.java,v 1.1 2004/06/03 16:30:01 steveebersole Exp $
2
package org.hibernate.auction;
3
4 /**
5  * @author Gavin King
6  */

7 public class Name {
8     private String JavaDoc firstName;
9     private String JavaDoc lastName;
10     private Character JavaDoc initial;
11     private Name() {}
12     public Name(String JavaDoc first, Character JavaDoc middle, String JavaDoc last) {
13         firstName = first;
14         initial = middle;
15         lastName = last;
16     }
17     public String JavaDoc getFirstName() {
18         return firstName;
19     }
20
21     public void setFirstName(String JavaDoc firstName) {
22         this.firstName = firstName;
23     }
24
25     public Character JavaDoc getInitial() {
26         return initial;
27     }
28
29     public void setInitial(Character JavaDoc initial) {
30         this.initial = initial;
31     }
32
33     public String JavaDoc getLastName() {
34         return lastName;
35     }
36
37     public void setLastName(String JavaDoc lastName) {
38         this.lastName = lastName;
39     }
40     
41     public String JavaDoc toString() {
42         StringBuffer JavaDoc buf = new StringBuffer JavaDoc()
43             .append(firstName)
44             .append(' ');
45         if (initial!=null) buf.append(initial)
46             .append(' ');
47         return buf.append(lastName)
48             .toString();
49     }
50
51 }
52
Popular Tags