-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFulltimeEmployee.java
More file actions
49 lines (39 loc) · 1.05 KB
/
FulltimeEmployee.java
File metadata and controls
49 lines (39 loc) · 1.05 KB
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
39
40
41
42
43
44
45
46
47
48
49
package designpattern.behavioral_pattern.visitor.v1;
/**
* <p>Description: 全职员工类:具体元素类</p>
*
* @author Cui Kaihui
* @date 2019/6/27 22:18
*/
public class FulltimeEmployee implements Employee {
private String name;
private double weeklyWage;
private int workTime;
public FulltimeEmployee(String name, double weeklyWage, int workTime) {
this.name = name;
this.weeklyWage = weeklyWage;
this.workTime = workTime;
}
public void setName(String name) {
this.name = name;
}
public void setWeeklyWage(double weeklyWage) {
this.weeklyWage = weeklyWage;
}
public void setWorkTime(int workTime) {
this.workTime = workTime;
}
public String getName() {
return (this.name);
}
public double getWeeklyWage() {
return (this.weeklyWage);
}
public int getWorkTime() {
return (this.workTime);
}
@Override
public void accept(Department handler) {
handler.visit(this); //调用访问者的访问方法
}
}