Repository navigation
Expand file tree
/
Copy pathPatient.java
More file actions
93 lines (74 loc) · 2.74 KB
/
Copy pathPatient.java
File metadata and controls
93 lines (74 loc) · 2.74 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
87
88
89
90
91
92
93
package One;
import java.util.Objects;
import One.Vaccine;
public class Patient extends Vaccine{
private String patient_name;
private long healthcare_num;
private String email_address;
private String phone_number;
private static int number_patients = 0;
private Vaccine vaccine;
public Patient() {
}
public Patient(String patient_name, long healthcare_num, String email_address, String phone_number, Vaccine vaccine) {
super(vaccine.getDay1(), vaccine.getDay2(), vaccine.getType(), vaccine.getCl_a());
this.patient_name = patient_name;
this.healthcare_num = healthcare_num;
this.email_address = email_address;
this.phone_number = phone_number;
this.vaccine = vaccine;
}
public String getPatient_name() {
return patient_name;
}
public void setPatient_name(String patient_name) {
this.patient_name = patient_name;
}
public long getHealthcare_num() {
return healthcare_num;
}
public void setHealthcare_num(long healthcare_num) {
this.healthcare_num = healthcare_num;
}
public String getEmail_address() {
return email_address;
}
public void setEmail_address(String email_address) {
this.email_address = email_address;
}
public String getPhone_number() {
return phone_number;
}
public void setPhone_number(String phone_number) {
this.phone_number = phone_number;
}
public static int getNumber_patients() {
return number_patients;
}
public static void setNumber_patients(int number_patients) {
Patient.number_patients = number_patients;
}
public Vaccine getVaccine() {
return vaccine;
}
public void setVaccine(Vaccine vaccine) {
this.vaccine = vaccine;
}
@Override
public String toString() {
return "Patient: " +
"patient_name='" + patient_name + '\'' +
", healthcare_num=" + healthcare_num +
", email_address='" + email_address + '\'' +
", phone_number='" + phone_number + '\'' +
vaccine.toString() + "\n";
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
Patient patient = (Patient) o;
return healthcare_num == patient.healthcare_num && Objects.equals(patient_name, patient.patient_name) && Objects.equals(email_address, patient.email_address) && Objects.equals(phone_number, patient.phone_number) && Objects.equals(vaccine, patient.vaccine);
}
}