forked from caalvar13/Manager_System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeeManager.java
More file actions
158 lines (135 loc) · 3.96 KB
/
EmployeeManager.java
File metadata and controls
158 lines (135 loc) · 3.96 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// /*PLEASE DO NOT EDIT THIS CODE*/
// /*This code was generated using the UMPLE 1.31.1.5860.78bb27cc6 modeling language!*/
// import java.util.*;
// // line 29 "model.ump"
// // line 152 "model.ump"
// public class EmployeeManager
// {
// //------------------------
// // MEMBER VARIABLES
// //------------------------
// //EmployeeManager Associations
// private List<Employee> employees;
// //------------------------
// // CONSTRUCTOR
// //------------------------
// public EmployeeManager()
// {
// employees = new ArrayList<Employee>();
// }
// //------------------------
// // INTERFACE
// //------------------------
// /* Code from template association_GetMany */
// public Employee getEmployee(int index)
// {
// Employee aEmployee = employees.get(index);
// return aEmployee;
// }
// public List<Employee> getEmployees()
// {
// List<Employee> newEmployees = Collections.unmodifiableList(employees);
// return newEmployees;
// }
// public int numberOfEmployees()
// {
// int number = employees.size();
// return number;
// }
// public boolean hasEmployees()
// {
// boolean has = employees.size() > 0;
// return has;
// }
// public int indexOfEmployee(Employee aEmployee)
// {
// int index = employees.indexOf(aEmployee);
// return index;
// }
// /* Code from template association_MinimumNumberOfMethod */
// public static int minimumNumberOfEmployees()
// {
// return 0;
// }
// /* Code from template association_AddManyToOne */
// public Employee addEmployee(String aName, double aSalary, Store aStore)
// {
// return new Employee(aName, aSalary, aStore, this);
// }
// public boolean addEmployee(Employee aEmployee)
// {
// boolean wasAdded = false;
// if (employees.contains(aEmployee)) { return false; }
// EmployeeManager existingEmployeeManager = aEmployee.getEmployeeManager();
// boolean isNewEmployeeManager = existingEmployeeManager != null && !this.equals(existingEmployeeManager);
// if (isNewEmployeeManager)
// {
// aEmployee.setEmployeeManager(this);
// }
// else
// {
// employees.add(aEmployee);
// }
// wasAdded = true;
// return wasAdded;
// }
// public boolean removeEmployee(Employee aEmployee)
// {
// boolean wasRemoved = false;
// //Unable to remove aEmployee, as it must always have a employeeManager
// if (!this.equals(aEmployee.getEmployeeManager()))
// {
// employees.remove(aEmployee);
// wasRemoved = true;
// }
// return wasRemoved;
// }
// /* Code from template association_AddIndexControlFunctions */
// public boolean addEmployeeAt(Employee aEmployee, int index)
// {
// boolean wasAdded = false;
// if(addEmployee(aEmployee))
// {
// if(index < 0 ) { index = 0; }
// if(index > numberOfEmployees()) { index = numberOfEmployees() - 1; }
// employees.remove(aEmployee);
// employees.add(index, aEmployee);
// wasAdded = true;
// }
// return wasAdded;
// }
// public boolean addOrMoveEmployeeAt(Employee aEmployee, int index)
// {
// boolean wasAdded = false;
// if(employees.contains(aEmployee))
// {
// if(index < 0 ) { index = 0; }
// if(index > numberOfEmployees()) { index = numberOfEmployees() - 1; }
// employees.remove(aEmployee);
// employees.add(index, aEmployee);
// wasAdded = true;
// }
// else
// {
// wasAdded = addEmployeeAt(aEmployee, index);
// }
// return wasAdded;
// }
// public void delete()
// {
// for(int i=employees.size(); i > 0; i--)
// {
// Employee aEmployee = employees.get(i - 1);
// aEmployee.delete();
// }
// }
// // line 33 "model.ump"
// private void trackSalaries(){
// }
// // line 36 "model.ump"
// private void manageTimeSchedule(){
// }
// // line 39 "model.ump"
// private void trackHoursWorked(){
// }
// }