public class CalendarDateCalculator extends AbstractDateCalculator<Calendar>
DAYS_IN_WEEK| Constructor and Description |
|---|
CalendarDateCalculator() |
CalendarDateCalculator(String name,
Calendar startDate,
HolidayCalendar<Calendar> holidayCalendar,
HolidayHandler<Calendar> holidayHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkBoundary(Calendar date)
This may throw an
IndexOutOfBoundsException if the date is not within the
boundaries. |
protected Calendar |
clone(Calendar date) |
protected Calendar |
compareDate(Calendar date1,
Calendar date2,
boolean returnEarliest) |
protected DateCalculator<Calendar> |
createNewCalculator(String name,
Calendar startDate,
HolidayCalendar<Calendar> holidays,
HolidayHandler<Calendar> handler) |
int |
getNumberOfBusinessDaysBetween(Calendar d1,
Calendar d2)
Number of non weekend, non holidays days between d1 and d2, using the Holiday Handler type to match
what the method moveByBusinessDays requires.
|
protected Calendar |
getToday() |
boolean |
isWeekend(Calendar date)
is the date a non-working day according to the WorkingWeek?
|
CalendarDateCalculator |
moveByDays(int days)
This changes the current business date held in the calculator, it moves
the new current business date by the number of days and, if it falls on a
weekend or holiday, moves it further according to the HolidayHandler
given in this DateCalculator.
|
DateCalculator<Calendar> |
moveByMonths(int months) |
DateCalculator<Calendar> |
setWorkingWeek(WorkingWeek week)
Allows user to define what their Working Week should be (default is
Mon-Fri).
|
applyTenor, calculateTenorDates, calculateTenorDates, combine, forceCurrentDateNoAdjustment, getCurrentBusinessDate, getCurrentIncrement, getHolidayCalendar, getHolidayHandler, getHolidayHandlerType, getName, getStartDate, isCurrentDateNonWorking, isNonWorkingDay, moveByBusinessDays, moveByTenor, moveByTenor, moveToSpotDate, setCurrentBusinessDate, setCurrentIncrement, setHolidayCalendar, setHolidayHandler, setName, setStartDatepublic CalendarDateCalculator()
public CalendarDateCalculator(String name, Calendar startDate, HolidayCalendar<Calendar> holidayCalendar, HolidayHandler<Calendar> holidayHandler)
public DateCalculator<Calendar> setWorkingWeek(WorkingWeek week)
DateCalculatorweek - an immutable definition of a week.public boolean isWeekend(Calendar date)
public CalendarDateCalculator moveByDays(int days)
DateCalculatordays - number of days (can be <0 or >0)public DateCalculator<Calendar> moveByMonths(int months)
moveByMonths in class AbstractDateCalculator<Calendar>protected DateCalculator<Calendar> createNewCalculator(String name, Calendar startDate, HolidayCalendar<Calendar> holidays, HolidayHandler<Calendar> handler)
createNewCalculator in class AbstractDateCalculator<Calendar>protected final Calendar getToday()
getToday in class AbstractDateCalculator<Calendar>protected Calendar compareDate(Calendar date1, Calendar date2, boolean returnEarliest)
compareDate in class AbstractDateCalculator<Calendar>protected void checkBoundary(Calendar date)
AbstractDateCalculatorIndexOutOfBoundsException if the date is not within the
boundaries.checkBoundary in class AbstractDateCalculator<Calendar>protected Calendar clone(Calendar date)
clone in class AbstractDateCalculator<Calendar>public int getNumberOfBusinessDaysBetween(Calendar d1, Calendar d2)
DateCalculatord1 - start dated2 - end dateCopyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.