-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFullTimeEmployee.java
More file actions
48 lines (41 loc) · 1.39 KB
/
FullTimeEmployee.java
File metadata and controls
48 lines (41 loc) · 1.39 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
import java.util.ArrayList;
import java.util.List;
public class FullTimeEmployee extends Employee {
private List<PayStatement> payHistory;
public FullTimeEmployee(String name, String phoneNumber, String emailAddress, int empId, String ssn, double salary, String jobTitle, String division) {
this.name = name;
this.phoneNumber = phoneNumber;
this.emailAddress = emailAddress;
this.empId = empId;
this.ssn = ssn;
this.salary = salary;
this.jobTitle = jobTitle;
this.division = division;
this.payHistory = new ArrayList<>();
}
@Override
public void updateData(String field, String newValue) {
switch (field.toLowerCase()) {
case "name": name = newValue; break;
case "phonenumber": phoneNumber = newValue; break;
case "emailaddress": emailAddress = newValue; break;
case "jobtitle": jobTitle = newValue; break;
case "division": division = newValue; break;
case "ssn": ssn = newValue; break;
}
}
@Override
public double getSalary() {
return salary;
}
@Override
public void setSalary(double salary) {
this.salary = salary;
}
public List<PayStatement> getPayStatementHistory() {
return payHistory;
}
public void addPayStatement(PayStatement pay) {
payHistory.add(pay);
}
}