blob: 1d56055a2d3b0abf6a2daa29996ae723cad462d9 (
plain)
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
|
package clock;
public class DigitalClock implements Clock {
private ClockTimer subject;
public DigitalClock(ClockTimer subject) {
super();
this.subject = subject;
this.subject.addObserver(this);
}
public void removeObserver(Object observer) {
this.subject.observers.remove(observer);
}
public void update(ClockTimer subject, Object args) {
if (this.subject == subject) {
this.draw();
}
}
public void draw() {
int hour = this.subject.getHour();
int minute = this.subject.getMinute();
}
}
|