-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDayState.java
More file actions
38 lines (30 loc) · 825 Bytes
/
DayState.java
File metadata and controls
38 lines (30 loc) · 825 Bytes
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
public class DayState implements State {
private static DayState singleton = new DayState();
private DayState() {
}
public static State getInstance() {
return singleton;
}
@Override
public void doClock(Context context, int hour) {
if (hour < 9 || 17 <= hour) {
context.changeState(NightState.getInstance());
}
}
@Override
public void doUse(Context context) {
context.recordLog("금고 사용(주간)");
}
@Override
public void doAlarm(Context context) {
context.callSecurityCenter("비상벨(주간)");
}
@Override
public void doPhone(Context context) {
context.callSecurityCenter("일반 통화(주간)");
}
@Override
public String toString() {
return "[주간]";
}
}