-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoctor.java
More file actions
executable file
·86 lines (68 loc) · 2.36 KB
/
Copy pathDoctor.java
File metadata and controls
executable file
·86 lines (68 loc) · 2.36 KB
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
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package hospitalmanagementsystem;
/**
*
* @author egehanhatipoglu
*/
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
/**
*
* @author egehanhatipoglu
*/
public class Doctor {
private int id;
private String firstName;
private String lastName;
private Department department;
private String phone;
private AppointmentQueue dailyQueue;
// Constructor: Initializes the doctor's details and creates a specific
// AppointmentQueue for this doctor to manage their daily patient flow (FIFO).
public Doctor(int id, String firstName, String lastName, Department department, String phone) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
this.department = department;
this.phone = phone;
this.dailyQueue = new AppointmentQueue();
}
// Getters
public int getId() { return id; }
public String getFirstName() {
return firstName;
}
public String getLastName() { return lastName; }
public Department getDepartment() { return department; }
public String getPhone() { return phone; }
// Critical method: Accesses the doctor's daily appointment queue.
// Used by the main system to enqueue new appointments or dequeue the next patient for examination.
public AppointmentQueue getDailyQueue() { return dailyQueue; }
public void setDepartment(Department department) {
this.department = department;
}
public void setId(int id) {
this.id = id;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setPhone(String phone) {
this.phone = phone;
}
public void setDailyQueue(AppointmentQueue dailyQueue) {
this.dailyQueue = dailyQueue;
}
@Override
public String toString() {
return "Dr. " + firstName + " " + lastName + " (" + department.getName() + ")";
}
}