1 | public class Employee {↵ | | 1 | public class Person {↵
|
2 | private String personName;↵ | | 2 | private String name;↵
|
3 | private Person person;↵ | | 3 | private ↵
|
4 | private Collection employments = new ArrayList(); ↵ | | |
|
5 | Employee() {}↵ | | |
|
6 | public Employee(Person p) {↵ | | |
|
7 | this.person = p;↵ | | |
|
8 | this.personName = p.getName();↵ | | |
|
9 | p.setEmployee(this);↵ | | |
|
10 | }↵ | | |
|
11 | public Person getPerson↵ | | 4 | Date dob;↵
|
| | | 5 | private String currentAddress;↵
|
| | | 6 | Person() {}↵
|
| | | 7 | public Person(String name, Date dob, String address) {↵
|
| | | 8 | this.name = name;↵
|
| | | 9 | this.dob = dob;↵
|
| | | 10 | this.currentAddress = address;↵
|
| | | 11 | }↵
|
12 | () {↵ | | 12 | public Date getDob() {↵
|
13 | return person;↵ | | 13 | return dob;↵
|
14 | }↵ | | 14 | }↵
|
15 | public void setPerson(Person person) {↵ | | 15 | public void set↵
|
16 | this.person = person↵ | | 16 | Dob(Date dob) {↵
|
17 | ;↵ | | 17 | this.dob = dob;↵
|
18 | }↵ | | 18 | }↵
|
19 | public String getPersonName() {↵ | | 19 | public String getName() {↵
|
20 | return personName;↵ | | 20 | return name;↵
|
21 | }↵ | | 21 | }↵
|
22 | public void setPersonName(String personName) {↵ | | 22 | public void setName(String name) {↵
|
23 | this.personName = personName;↵ | | 23 | this.↵
|
24 | }↵ | | |
|
25 | public Collection getEmployment↵ | | 24 | name = name;↵
|
| | | 25 | }↵
|
26 | s() {↵ | | 26 | public String getCurrentAddress() {↵
|
27 | return employments;↵ | | 27 | return currentAddress;↵
|
28 | }↵ | | 28 | }↵
|
29 | public void setEmployments(Collection employments) {↵ | | 29 | public void set↵
|
30 | this.employments = employment↵ | | 30 | CurrentAddress(String currentAddress) {↵
|
31 | s | | 31 | this.currentAddress = currentAddress
|