forked from Quillion/Apartments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPerson.java
88 lines (72 loc) · 1.57 KB
/
Person.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import java.util.List;
import java.util.ArrayList;
public class Person
{
private String name;
private List<Car> cars;
private List<PhoneNumber> phone_numbers;
private List<Locker> lockers;
public Person()
{
this.name = "";
this.cars = new ArrayList<Car>();
this.phone_numbers = new ArrayList<PhoneNumber>();
this.lockers = new ArrayList<Locker>();
}
public String getName()
{
return this.name;
}
public void setName(String name)
{
this.name = name;
}
public Car getCar()
{
return this.cars.get(0);
}
public Car getCar(int number)
{
return this.cars.get(number);
}
public void addCar(Car car)
{
this.cars.add(car);
}
public int getCarCount()
{
return this.cars.size();
}
public PhoneNumber getPhoneNumber()
{
return this.phone_numbers.get(0);
}
public PhoneNumber getPhoneNumber(int number)
{
return this.phone_numbers.get(number);
}
public void addPhoneNumber(PhoneNumber phone_number)
{
this.phone_numbers.add(phone_number);
}
public int getPhoneCount()
{
return this.phone_numbers.size();
}
public Locker getLocker()
{
return this.lockers.get(0);
}
public Locker getLocker(int number)
{
return this.lockers.get(number);
}
public void addLocker(Locker locker)
{
this.lockers.add(locker);
}
public int getLockerCount()
{
return this.lockers.size();
}
}