public class DateDateCalculator extends AbstractDateCalculator<Date>
DAYS_IN_WEEK
Constructor and Description |
---|
DateDateCalculator() |
DateDateCalculator(String name,
Date startDate,
HolidayCalendar<Date> holidayCalendar,
HolidayHandler<Date> holidayHandler) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkBoundary(Date date)
This may throw an
IndexOutOfBoundsException if the date is not within the
boundaries. |
protected Date |
clone(Date date) |
protected Date |
compareDate(Date date1,
Date date2,
boolean returnEarliest) |
protected DateCalculator<Date> |
createNewCalculator(String name,
Date startDate,
HolidayCalendar<Date> holidays,
HolidayHandler<Date> handler) |
int |
getNumberOfBusinessDaysBetween(Date d1,
Date 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 Date |
getToday() |
boolean |
isWeekend(Date date)
is the date a non-working day according to the WorkingWeek?
|
DateCalculator<Date> |
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.
|
protected DateCalculator<Date> |
moveByMonths(int months) |
DateCalculator<Date> |
setStartDate(Date startDate)
Set both start date and current date
|
DateCalculator<Date> |
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
public DateDateCalculator()
public DateDateCalculator(String name, Date startDate, HolidayCalendar<Date> holidayCalendar, HolidayHandler<Date> holidayHandler)
public DateCalculator<Date> setWorkingWeek(WorkingWeek week)
DateCalculator
week
- an immutable definition of a week.public boolean isWeekend(Date date)
public DateCalculator<Date> moveByDays(int days)
DateCalculator
days
- number of days (can be <0 or >0)protected DateCalculator<Date> createNewCalculator(String name, Date startDate, HolidayCalendar<Date> holidays, HolidayHandler<Date> handler)
createNewCalculator
in class AbstractDateCalculator<Date>
public final DateCalculator<Date> setStartDate(Date startDate)
AbstractDateCalculator
setStartDate
in interface DateCalculator<Date>
setStartDate
in class AbstractDateCalculator<Date>
startDate
- the reference date for this calculator, the current business
date is also updated and may be moved if it falls on a non
working day (holiday/weekend).protected final Date getToday()
getToday
in class AbstractDateCalculator<Date>
protected DateCalculator<Date> moveByMonths(int months)
moveByMonths
in class AbstractDateCalculator<Date>
protected Date compareDate(Date date1, Date date2, boolean returnEarliest)
compareDate
in class AbstractDateCalculator<Date>
protected void checkBoundary(Date date)
AbstractDateCalculator
IndexOutOfBoundsException
if the date is not within the
boundaries.checkBoundary
in class AbstractDateCalculator<Date>
protected Date clone(Date date)
clone
in class AbstractDateCalculator<Date>
public int getNumberOfBusinessDaysBetween(Date d1, Date d2)
DateCalculator
d1
- start dated2
- end dateCopyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.