|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.ss.formula.atp.WorkdayCalculator
public class WorkdayCalculator
A calculator for workdays, considering dates as excel representations.
Field Summary | |
---|---|
static WorkdayCalculator |
instance
|
Method Summary | |
---|---|
protected int |
calculateNonWeekendHolidays(double start,
double end,
double[] holidays)
Calculates how many holidays in a list are workdays, considering an interval of dates. |
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. |
protected boolean |
isHoliday(double aDate,
double[] holidays)
|
protected boolean |
isInARange(double start,
double end,
double aDate)
|
protected int |
isNonWorkday(double aDate,
double[] holidays)
|
protected boolean |
isWeekend(double aDate)
|
protected int |
pastDaysOfWeek(double start,
double end,
int dayOfWeek)
Calculates how many days of week past between a start and an end date. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final WorkdayCalculator instance
Method Detail |
---|
public int calculateWorkdays(double start, double end, double[] holidays)
start
- start date.end
- end date.holidays
- an array of holidays.
public java.util.Date calculateWorkdays(double start, int workdays, double[] holidays)
start
- start date.workdays
- number of workdays to be past from starting date.holidays
- an array of holidays.
protected int pastDaysOfWeek(double start, double end, int dayOfWeek)
start
- start date.end
- end date.dayOfWeek
- a day of week as represented by Calendar
constants.
protected int calculateNonWeekendHolidays(double start, double end, double[] holidays)
start
- start date.end
- end date.holidays
- an array of holidays.
protected boolean isWeekend(double aDate)
aDate
- a given date.
true
if date is weekend, false
otherwise.protected boolean isHoliday(double aDate, double[] holidays)
aDate
- a given date.holidays
- an array of holidays.
true
if date is a holiday, false
otherwise.protected int isNonWorkday(double aDate, double[] holidays)
aDate
- a given date.holidays
- an array of holidays.
1
is not a workday, 0
otherwise.protected boolean isInARange(double start, double end, double aDate)
start
- start date.end
- end date.aDate
- a date to be analyzed.
true
if aDate is between start and end dates, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |