01: package ie.beaumont.epilepsy;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: /**
07: *
08: * @author luano
09: */
10: public class ClinicDAO {
11: private int clinicId;
12: private String clinicName;
13:
14: private ArrayList patients;
15:
16: /** Creates a new instance of ClinicDao */
17: public ClinicDAO() {
18: patients = new ArrayList();
19: addDummyPatients();
20: }
21:
22: /** Creates a new instance of ClinicDao */
23: public ClinicDAO(String name) {
24: clinicName = name;
25: patients = new ArrayList();
26: addDummyPatients();
27: }
28:
29: private void addDummyPatients() {
30: Patient p = new Patient();
31: p.setPatientId(1001);
32: p.setName("John Devereaux");
33: patients.add(p);
34:
35: p = new Patient();
36: p.setPatientId(1002);
37: p.setName("Paddy Joe McPadden");
38: patients.add(p);
39:
40: p = new Patient();
41: p.setPatientId(1009);
42: p.setName("Denis Hickey");
43: patients.add(p);
44: }
45:
46: public Integer getClinicId() {
47: return new Integer(clinicId);
48: }
49:
50: public void setClinicId(int id) {
51: clinicId = id;
52: }
53:
54: public String getClinicName() {
55: return clinicName;
56: }
57:
58: public void setClinicName(String n) {
59: clinicName = n;
60: }
61:
62: public List getPatients() {
63: return patients;
64: }
65: }
|