1 | public class Employee {↵ | | 1 | public class Location {↵
|
2 | private String personName;↵ | | 2 | private ↵
|
3 | private Person person↵ | | 3 | long id;↵
|
4 | ;↵ | | 4 | private String name;↵
|
5 | private Collection employments = new ArrayList(); ↵ | | 5 | private Collection beings = new ArrayList();↵
|
6 | Employee↵ | | |
|
| | | 6 | ↵
|
7 | () {}↵ | | 7 | Location() {}↵
|
8 | ↵ | | 8 | ↵
|
9 | public Employee(Person p) {↵ | | 9 | public ↵
|
10 | this.person = p;↵ | | |
|
11 | this.personName = p.getName();↵ | | |
|
12 | p.setEmployee(this);↵ | | |
|
13 | }↵ | | 10 | Location(String name) {↵
|
| | | 11 | this.name = name;↵
|
| | | 12 | }↵
|
| | | 13 | ↵
|
| | | 14 | public void addBeing(Being b) {↵
|
| | | 15 | b.setLocation(this);↵
|
| | | 16 | beings.add(b);↵
|
| | | 17 | }↵
|
| | | 18 | /**↵
|
| | | 19 | * @return Returns the id.↵
|
| | | 20 | */↵
|
14 | public Person getPerson() {↵ | | 21 | public long getId() {↵
|
15 | return person;↵ | | 22 | return ↵
|
16 | }↵ | | 23 | id;↵
|
| | | 24 | }↵
|
| | | 25 | /**↵
|
| | | 26 | * @param id The id to set.↵
|
| | | 27 | */↵
|
17 | public void setPerson(Person person) {↵ | | 28 | public void set↵
|
18 | this.person = person;↵ | | |
|
19 | }↵ | | 29 | Id(long id) {↵
|
| | | 30 | this.id = id;↵
|
| | | 31 | }↵
|
| | | 32 | /**↵
|
| | | 33 | * @return Returns the name.↵
|
| | | 34 | */↵
|
20 | public String getPersonName() {↵ | | 35 | public String getName() {↵
|
21 | return personName;↵ | | 36 | return ↵
|
22 | }↵ | | 37 | name;↵
|
| | | 38 | }↵
|
| | | 39 | /**↵
|
| | | 40 | * @param name The name to set.↵
|
| | | 41 | */↵
|
23 | public void setPersonName(String personName) {↵ | | 42 | public void setName(String name) {↵
|
24 | this.personName = personName;↵ | | 43 | this.↵
|
25 | }↵ | | 44 | name = name;↵
|
| | | 45 | }↵
|
| | | 46 | /**↵
|
| | | 47 | * @return Returns the beings.↵
|
| | | 48 | */↵
|
26 | public Collection getEmployments() {↵ | | 49 | public Collection getBeings() {↵
|
27 | return employments;↵ | | 50 | return ↵
|
28 | }↵ | | 51 | beings;↵
|
| | | 52 | }↵
|
| | | 53 | /**↵
|
| | | 54 | * @param beings The beings to set.↵
|
| | | 55 | */↵
|
29 | public void setEmployments(Collection employments) {↵ | | 56 | public void setBeings(Collection beings) {↵
|
30 | this.employments = employments;↵ | | 57 | this.beings = beings;↵
|
31 | | | 58 |
|