Package org.apache.poi.ss.formula.atp
Class WorkdayCalculator
- java.lang.Object
-
- org.apache.poi.ss.formula.atp.WorkdayCalculator
-
public class WorkdayCalculator extends java.lang.Object
A calculator for workdays, considering dates as excel representations.
-
-
Field Summary
Fields Modifier and Type Field Description static WorkdayCalculator
instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
calculateWorkdays(double start, double end, double[] holidays)
Calculate how many workdays are there between a start and an end date, as excel representations, considering a range of holidays.java.util.Date
calculateWorkdays(double start, int workdays, double[] holidays)
Calculate the workday past x workdays from a starting date, considering a range of holidays.
-
-
-
Field Detail
-
instance
public static final WorkdayCalculator instance
-
-
Method Detail
-
calculateWorkdays
public int calculateWorkdays(double start, double end, double[] holidays)
Calculate how many workdays are there between a start and an end date, as excel representations, considering a range of holidays.- Parameters:
start
- start date.end
- end date.holidays
- an array of holidays.- Returns:
- number of workdays between start and end dates, including both dates.
-
calculateWorkdays
public java.util.Date calculateWorkdays(double start, int workdays, double[] holidays)
Calculate the workday past x workdays from a starting date, considering a range of holidays.- Parameters:
start
- start date.workdays
- number of workdays to be past from starting date.holidays
- an array of holidays.- Returns:
- date past x workdays.
-
-