Package username
Class PayrollGenerator
java.lang.Object
username.PayrollGenerator
Generates the payroll for a company.
Field Summary
Modifier and Type
Field
Description
public static final int
The length of the pay period in days.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
Gets the number of hours in the timesheet file between the start (inclusive) and end dates (exclusive).static void
readStaffList
(String filename) Creates an List of Employees from the provided staff list.
-
Constructor Details
-
PayrollGenerator
public PayrollGenerator()
-
-
Method Details
-
getHours
public static double getHours(String filename, LocalDate periodStart, LocalDate periodEnd) throws IOException, IllegalArgumentException Gets the number of hours in the timesheet file between the start (inclusive) and end dates (exclusive).- Parameters:
filename
- Filename for the timesheet.periodStart
- Start date.periodEnd
- End date.- Returns:
- Hours worked between the start and end dates.
- Throws:
IOException
- If the timesheet file can not be opened.IllegalArgumentException
- If the extension is not .csv.
-
readStaffList
public static List<Employee> readStaffList(String filename) throws IOException, IllegalArgumentException Creates an List of Employees from the provided staff list.- Parameters:
filename
- .xml file for the staff list- Returns:
- List of Employees generated from the staff list.
- Throws:
IOException
- If the file can not be opened.IllegalArgumentException
- If the extension is not .xml.
-
main
-