added lab15 ex1
This commit is contained in:
19
src/lab15_observer/ex1/MedicalEmployee.java
Normal file
19
src/lab15_observer/ex1/MedicalEmployee.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package lab15_observer.ex1;
|
||||
|
||||
public class MedicalEmployee implements PatientObserver {
|
||||
private final String name;
|
||||
|
||||
public MedicalEmployee(String name, PatientMonitoring pm) {
|
||||
this.name = name;
|
||||
pm.registerObserver(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Problem problem, PatientMonitoring pm) {
|
||||
System.out.println(getName() + " has been notified of " + problem + " for patient " + pm);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user