-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSupervisor.java
More file actions
117 lines (109 loc) · 2.05 KB
/
Supervisor.java
File metadata and controls
117 lines (109 loc) · 2.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import java.io.File;
import java.io.FileWriter;
import java.util.*;
public class Supervisor {
private String ID,username,name,department,DOB,address;
private List<Staff> staff_under_me;
private int no_of_staff,no_of_tasks;
void Supervisor(String ID, String username, String department, String DOB, String address)
{
this.setID(ID);
this.setUsername(username);
this.setName(department);
this.setDepartment(department);
this.setDOB(DOB);
this.setAddress(address);
}
private void setAddress(String address2) {
this.address=address2;
}
private void setDOB(String dOB2) {
this.DOB=dOB2;
}
void setID(String ID)
{
this.ID=ID;
}
void setName(String Name)
{
this.name=Name;
}
void setDepartment(String dep)
{
this.department=dep;
}
void setUsername(String Username)
{
this.username=Username;
}
String getID()
{
return this.ID;
}
String getUsername()
{
return this.ID;
}
String getName()
{
return this.ID;
}
String getDepartment()
{
return this.ID;
}
String getDOB()
{
return this.ID;
}
String getAddress()
{
return this.ID;
}
int getStaffNumber()
{
return this.no_of_staff;
}
int getTaskNumber()
{
return this.no_of_tasks;
}
List getStaff()
{
return this.staff_under_me;
}
void addStaff(Staff staff)
{
staff_under_me.add(staff);
}
void viewStaff()
{
System.out.println(staff_under_me);
}
void deleteStaff(Staff staff)
{
this.no_of_staff--;
this.staff_under_me.remove(staff);
//rewrite file
File myFile = new File("Supervisor.csv");
/*try
{
FileWriter fileWriter = new FileWriter(myFile,true);
StringBuilder string1=new StringBuilder();
// string1.append("\r\n"+text+","+selecteditem+","+staff.getID()+","+staff.getDepartment()+","+"Unapproved");
fileWriter.write(string1.toString());
System.out.println(string1);
fileWriter.close();
}
catch(Exception e){}*/
}
void assignTask(Task task) //pass parameter to assign to only 1, some or all
{
}
void sendLeave(Leave l)
{
}
void handleLeave(Leave l)
{
}
}