net.finmath.time.businessdaycalendar
Interface BusinessdayCalendarInterface
-
- All Known Implementing Classes:
- BusinessdayCalendar, BusinessdayCalendarAny, BusinessdayCalendarExcludingTARGETHolidays, BusinessdayCalendarExcludingWeekends
public interface BusinessdayCalendarInterface
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static classBusinessdayCalendarInterface.DateRollConvention
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.util.CalendargetAdjustedDate(java.util.Calendar date, BusinessdayCalendarInterface.DateRollConvention dateRollConvention)Get an adjusted date for a given date.java.util.CalendargetAdjustedDate(java.util.Calendar baseDate, java.lang.String dateOffsetCode, BusinessdayCalendarInterface.DateRollConvention dateRollConvention)Get an adjusted date for a given date and offset code.java.util.CalendargetRolledDate(java.util.Calendar baseDate, int businessDays)Find a new date by adding the given number of business days to a given base date.booleanisBusinessday(java.util.Calendar date)Test if a given date is a businessday.
-
-
-
Method Detail
-
isBusinessday
boolean isBusinessday(java.util.Calendar date)
Test if a given date is a businessday.- Parameters:
date- The given date.- Returns:
- True, if the given date is a businessday, otherwise false.
-
getAdjustedDate
java.util.Calendar getAdjustedDate(java.util.Calendar date, BusinessdayCalendarInterface.DateRollConvention dateRollConvention)Get an adjusted date for a given date. Sincejava.util.Calendaris not immutable this method has to return a clone of date, even if the roll convention is not resulting in an adjustment.- Parameters:
date- Given date to be adjusted.dateRollConvention- The date roll convention to be used for the adjustment.- Returns:
- The adjusted date applying dateRollConvention to the given date.
-
getAdjustedDate
java.util.Calendar getAdjustedDate(java.util.Calendar baseDate, java.lang.String dateOffsetCode, BusinessdayCalendarInterface.DateRollConvention dateRollConvention)Get an adjusted date for a given date and offset code. Sincejava.util.Calendaris not immutable this method has to return a clone of baseDate, even if the roll convention is not resulting in an adjustment. First we create a new date by "adding" an offset to the base date. The offset may be given by codes like 1D, 2D, 1W, 2W, 1M, 2M, 3M, 1Y, 2Y, etc., where the letters denote the units as follows: D denotes days, W denotes weeks, M denotes month Y denotes years. Next the result is adjusted according to the given dateRollConvention.- Parameters:
baseDate- The start date.dateOffsetCode- String containing date offset codes (like 2D, 1W, 3M, etc.) or combination of them separated by spaces.dateRollConvention- The date roll convention to be used for the adjustment.- Returns:
- The adjusted date applying dateRollConvention to the given date.
-
getRolledDate
java.util.Calendar getRolledDate(java.util.Calendar baseDate, int businessDays)Find a new date by adding the given number of business days to a given base date. Sincejava.util.Calendaris not immutable this method has to return a clone of baseDate, even if the roll convention is not resulting in an adjustment. If baseDate is not a business date and businessDays is zero, the method returns the next business day.- Parameters:
baseDate- The starting date.businessDays- The number of business days from the starting date (negative values are allowed).- Returns:
- A date of a business day such that the number of business days between this one (including) and the start date (excluding) is businessDays.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG