public class DaysToWorkingDaysReportConverter extends Object
TimeIntervalColumnHeaders
the converter creates a "table" with integer that represents the age in days from the largest
lower limit until the smallest upper limit of the timeIntervalColumnHeaders. This table is valid
for a whole day until the converter is initialized with bigger limits.| Modifier and Type | Method and Description |
|---|---|
int |
convertDaysToWorkingDays(int ageInDays)
Converts an integer, that represents the age in days, to the age in working days by using the
table that was created by initialization.
|
ArrayList<Integer> |
convertWorkingDaysToDays(int ageInWorkingDays)
Converts an integer, that represents the age in working days, to the age in days by using the
table that was created by initialization.
|
protected List<Integer> |
generateNegativeDaysToWorkingDays(List<? extends TimeIntervalColumnHeader> columnHeaders,
Instant referenceDate) |
protected List<Integer> |
generatePositiveDaysToWorkingDays(List<? extends TimeIntervalColumnHeader> columnHeaders,
Instant referenceDate) |
static DaysToWorkingDaysReportConverter |
initialize(List<? extends TimeIntervalColumnHeader> columnHeaders) |
static DaysToWorkingDaysReportConverter |
initialize(List<? extends TimeIntervalColumnHeader> columnHeaders,
Instant referenceDate)
Initializes the DaysToWorkingDaysConverter for a list of
TimeIntervalColumnHeaders and
a referenceDate. |
String |
toString() |
public static DaysToWorkingDaysReportConverter initialize(List<? extends TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException
InvalidArgumentExceptionpublic static DaysToWorkingDaysReportConverter initialize(List<? extends TimeIntervalColumnHeader> columnHeaders, Instant referenceDate) throws InvalidArgumentException
TimeIntervalColumnHeaders and
a referenceDate. A new table is only created if there are bigger limits or the date has
changed.columnHeaders - a list of TimeIntervalColumnHeaders that determines the size of
the tablereferenceDate - a Instant that represents the current day of the tableInvalidArgumentException - thrown if columnHeaders or referenceDate is nullpublic int convertDaysToWorkingDays(int ageInDays)
ageInDays - represents the age in dayspublic ArrayList<Integer> convertWorkingDaysToDays(int ageInWorkingDays)
ageInWorkingDays - represents the age in working daysprotected List<Integer> generateNegativeDaysToWorkingDays(List<? extends TimeIntervalColumnHeader> columnHeaders, Instant referenceDate)
protected List<Integer> generatePositiveDaysToWorkingDays(List<? extends TimeIntervalColumnHeader> columnHeaders, Instant referenceDate)
Copyright © 2020. All rights reserved.