2024-11-11 11:34:23 +01:00

20 lines
494 B
Java

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);
}
}