forked from quanke/design-pattern-java-source-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.java
More file actions
28 lines (22 loc) · 816 Bytes
/
Copy pathClient.java
File metadata and controls
28 lines (22 loc) · 816 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
public class Client
{
public static void main(String args[])
{
Leader objDirector,objManager,objGeneralManager,objViceGeneralManager;
objDirector=new Director("王明");
objManager=new Manager("赵强");
objGeneralManager=new GeneralManager("李波");
objViceGeneralManager=new ViceGeneralManager("肖红");
objDirector.setSuccessor(objManager);
objManager.setSuccessor(objViceGeneralManager);
objViceGeneralManager.setSuccessor(objGeneralManager);
LeaveRequest lr1=new LeaveRequest("张三",2);
objDirector.handleRequest(lr1);
LeaveRequest lr2=new LeaveRequest("李四",5);
objDirector.handleRequest(lr2);
LeaveRequest lr3=new LeaveRequest("王五",15);
objDirector.handleRequest(lr3);
LeaveRequest lr4=new LeaveRequest("赵六",25);
objDirector.handleRequest(lr4);
}
}