KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > lang > jpath > example > Person


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.taglibs.standard.lang.jpath.example;
18
19
20 import java.util.ArrayList JavaDoc;
21 import java.util.Collection JavaDoc;
22
23
24 public class Person {
25     private int id;
26     private String JavaDoc firstName = "" ;
27     private String JavaDoc lastName = "" ;
28     private String JavaDoc gender = "" ;
29     private Collection JavaDoc spouseFamilies;
30     private Collection JavaDoc childFamilies;
31     private Person father = null ;
32     private Event birth;
33     private Event death;
34     private Event burial;
35     private String JavaDoc note;
36
37         public Person(int id, String JavaDoc firstName,
38                  String JavaDoc lastName,
39                  String JavaDoc gender,
40                  Event birth,
41                  Event death,
42                  Event burial,
43                  String JavaDoc note) {
44         this.id = id;
45         this.firstName = firstName;
46             this.lastName = lastName;
47             this.gender = gender;
48         this.spouseFamilies = new ArrayList JavaDoc();
49         this.childFamilies = new ArrayList JavaDoc();
50         this.birth = birth;
51         this.death = death;
52         this.burial = burial;
53         this.note = note;
54         }
55
56     public int getId() {
57         return id;
58     }
59
60     public String JavaDoc getLastName() {
61         return lastName;
62     }
63
64     public String JavaDoc getFirstName() {
65         return firstName;
66     }
67
68     public String JavaDoc getGender() {
69         return gender;
70     }
71
72     public Event getBirth() {
73         return birth;
74     }
75
76     public Event getDeath() {
77         return death;
78     }
79
80     public Event getBurial() {
81         return burial;
82     }
83
84     public String JavaDoc getNote() {
85         return note;
86     }
87
88     public Collection JavaDoc getSpouseFamilies() {
89         return spouseFamilies;
90     }
91
92     public Collection JavaDoc getChildFamilies() {
93         return childFamilies;
94     }
95
96     public void addSpouseFamily(Family spouseFamily) {
97             spouseFamilies.add(spouseFamily);
98     }
99
100     public void addChildFamily(Family childFamily) {
101             childFamilies.add(childFamily);
102     }
103
104 }
105
Popular Tags