java.lang.Object
employee.manager.EmployeeManager
- All Implemented Interfaces:
EmployeeManagement
Manages employee-related operations.
This class provides methods for adding, updating, and terminating employee records,
retrieving employee records, and retrieving employee IDs and lists.
Utilizes interfaces
EmployeeDataService
and EmployeeManagement
for data access and management.
Available methods:
-
Constructor Summary
ConstructorsConstructorDescriptionEmployeeManager
(EmployeeDataService employeeDataService) Constructs an EmployeeManager object with the specified EmployeeDataService. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEmployee
(EmployeeRecord newRecord) Adds a new employee record.void
addEmployee_CSV
(String employeeCSVPath) Adds employees from a CSV file.Retrieves a list of active employee records.int
getAddedEmployeeNumber
(String filePath) Retrieves the number of added employees from a CSV file.Retrieves a list of employee IDs.Retrieves a list of all employee records.getEmployeeRecord
(int employeeID) Retrieves an employee record by its ID.void
terminateEmployee
(EmployeeRecord selectedEmployee) Terminates an employee.void
updateEmployee
(EmployeeRecord updatedRecord) Updates an existing employee record.
-
Constructor Details
-
EmployeeManager
Constructs an EmployeeManager object with the specified EmployeeDataService.- Parameters:
employeeDataService
- the data service for employee records
-
-
Method Details
-
addEmployee
Adds a new employee record.- Specified by:
addEmployee
in interfaceEmployeeManagement
- Parameters:
newRecord
- the new employee record to add- Throws:
EmployeeRecordsException
- if an error occurs while adding the employee record
-
updateEmployee
Updates an existing employee record.- Specified by:
updateEmployee
in interfaceEmployeeManagement
- Parameters:
updatedRecord
- the updated employee record- Throws:
EmployeeRecordsException
- if an error occurs while updating the employee record
-
terminateEmployee
Terminates an employee.- Specified by:
terminateEmployee
in interfaceEmployeeManagement
- Parameters:
selectedEmployee
- the employee record to terminate- Throws:
EmployeeRecordsException
- if an error occurs while terminating the employee
-
getEmployeeRecord
Retrieves an employee record by its ID.- Specified by:
getEmployeeRecord
in interfaceEmployeeManagement
- Parameters:
employeeID
- the ID of the employee- Returns:
- the employee record
-
getEmployeeList
Retrieves a list of all employee records.- Specified by:
getEmployeeList
in interfaceEmployeeManagement
- Returns:
- a list of employee records
-
getEmployeeIDList
Retrieves a list of employee IDs.- Specified by:
getEmployeeIDList
in interfaceEmployeeManagement
- Returns:
- a list of employee IDs
-
getActiveEmployeeList
Retrieves a list of active employee records.- Specified by:
getActiveEmployeeList
in interfaceEmployeeManagement
- Returns:
- a list of active employee records
-
getAddedEmployeeNumber
Retrieves the number of added employees from a CSV file.- Specified by:
getAddedEmployeeNumber
in interfaceEmployeeManagement
- Parameters:
filePath
- the path to the CSV file- Returns:
- the number of added employees
-
addEmployee_CSV
Adds employees from a CSV file.- Specified by:
addEmployee_CSV
in interfaceEmployeeManagement
- Parameters:
employeeCSVPath
- the path to the CSV file containing employee data
-