-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDoctor.java
60 lines (49 loc) · 1.52 KB
/
Doctor.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
import java.util.*;
public class Doctor {
private int doctorId;
private String name;
private String birthday;
private String specialization;
private String contact;
private ArrayList<Date> availabilities;
private HashMap<Date, ArrayList<Appointment>> allAppointments;
public Doctor(int doctorId, String name, String birthday, String specialization, String contact) {
this.doctorId = doctorId;
this.name = name;
this.birthday = birthday;
this.specialization = specialization;
this.contact = contact;
this.availabilities = new ArrayList<>();
this.allAppointments = new HashMap<>();
}
public int getDoctorId() {
return doctorId;
}
public String getName() {
return name;
}
public String getBirthday() {
return birthday;
}
public String getSpecialization() {
return specialization;
}
public String getContact() {
return contact;
}
public ArrayList<Date> getAvailabilities() {
return availabilities;
}
public void setAvailability(Date date) {
this.availabilities.add(date);
}
public HashMap<Date, ArrayList<Appointment>> getAllAppointments() {
return allAppointments;
}
public void setAppointment(Appointment appointment, Date date) {
if (!this.allAppointments.containsKey(date)) {
this.allAppointments.put(date, new ArrayList<>());
}
this.allAppointments.get(date).add(appointment);
}
}