-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataRecord.java
76 lines (61 loc) · 2.31 KB
/
DataRecord.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
// DataRecord class to store data records
public class DataRecord {
private static int count = 0;
private int id;
private int[] sensitivityLevels;
private String personalDetails;
private String sicknessDetails;
private String drugPrescriptions;
private String labTestPrescriptions;
public DataRecord(int id, int[] sensitivityLevels, String personalDetails,String sicknessDetails, String drugPrescriptions, String labTestPrescriptions) {
this.id = id;
this.sensitivityLevels = sensitivityLevels;
this.personalDetails = personalDetails;
this.sicknessDetails = sicknessDetails;
this.drugPrescriptions = drugPrescriptions;
this.labTestPrescriptions = labTestPrescriptions;
count++;
}
public static int getRecordCount(){
return count;
}
public int getId() {
return id;
}
public int[] getSensitivityLevels() {
return sensitivityLevels;
}
public String getPersonalDetails() {
return personalDetails;
}
public String getSicknessDetails() {
return sicknessDetails;
}
public String getDrugPrescriptions() {
return drugPrescriptions;
}
public String getLabTestPrescriptions() {
return labTestPrescriptions;
}
// Print the data record
public void printData() {
System.out.println("Data Record #" + id);
System.out.println("Sensitivity Levels: " + sensitivityLevels[0]+","+sensitivityLevels[1]+","+sensitivityLevels[2]+","+sensitivityLevels[3]);
System.out.println("Personal Details: " + personalDetails);
System.out.println("Sickness Details: " + sicknessDetails);
System.out.println("Drug Prescriptions: " + drugPrescriptions);
System.out.println("Lab Test Prescriptions: " + labTestPrescriptions);
}
public void setPersonalDetails(String personalDetails) {
this.personalDetails = personalDetails;
}
public void setSicknessDetails(String sicknessDetails) {
this.sicknessDetails = sicknessDetails;
}
public void setDrugPrescriptions(String drugPrescriptions) {
this.drugPrescriptions = drugPrescriptions;
}
public void setLabTestPrescriptions(String labTestPrescriptions) {
this.labTestPrescriptions = labTestPrescriptions;
}
}