public class Convention
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DR_ACTUAL
Date Roll Actual
|
static int |
DR_FOLL
Date Roll Following
|
static int |
DR_MOD_FOLL
Date Roll Modified Following
|
static int |
DR_MOD_PREV
Date Roll Modified Previous
|
static int |
DR_PREV
Date Roll Previous
|
static int |
WEEKDAY_HOLS
Week Day Holiday
|
static int |
WEEKEND_HOLS
Week End Holiday
|
Constructor and Description |
---|
Convention() |
Modifier and Type | Method and Description |
---|---|
static double |
AddBusinessDays(double dblDate,
int iNumDays,
java.lang.String strCalendar)
Add the specified number of business days and adjusts it according to the calendar set
|
static double |
Adjust(double dblDate,
java.lang.String strCalendar,
int iAdjustMode)
Adjust the given date in accordance with the adjustment mode and the calendar set
|
static int |
BusDays(double dblStart,
double dblFinish,
java.lang.String strCalendar)
Calculate the number of business days between the start and the end dates
|
static java.lang.String |
GetAvailableDC()
Get all available DRIP day count conventions
|
static java.util.Set<java.lang.String> |
GetHolLocations()
Retrieve the set of holiday locations
|
static int[] |
GetWeekendDays(java.lang.String strCalendarSet)
Get the week end days for the given holiday calendar set
|
static int |
Holidays(double dblStart,
double dblFinish,
java.lang.String strCalendar)
Calculate the number of holidays between the start and the end dates
|
static java.util.List<java.lang.Double> |
HolidaySet(double dblStart,
double dblFinish,
java.lang.String strCalendar)
Calculate the set of holidays between the start and the end dates
|
static boolean |
Init(java.lang.String strCalendarSetLoc)
Initialize the day count basis object from the calendar set
|
static boolean |
IsHoliday(double dblDate,
java.lang.String strCalendar)
Indicates whether the given date is a holiday in the specified location(s)
|
static boolean |
IsHoliday(double dblDate,
java.lang.String strCalendar,
int iHolType)
Indicate whether the given date is a holiday in the specified location(s)
|
static void |
main(java.lang.String[] astrArgs) |
static double |
RollDate(double dblDate,
int iRollMode,
java.lang.String strCalendarSet)
Roll the given date in accordance with the roll mode and the calendar set
|
static double |
YearFraction(double dblStart,
double dblEnd,
java.lang.String strDayCount,
boolean bApplyEOMAdj,
double dblMaturity,
ActActDCParams actactParams,
java.lang.String strCalendar)
Calculate the accrual fraction in years between 2 given days for the given day count convention and
the other parameters
|
public static final int DR_ACTUAL
public static final int DR_FOLL
public static final int DR_MOD_FOLL
public static final int DR_PREV
public static final int DR_MOD_PREV
public static final int WEEKDAY_HOLS
public static final int WEEKEND_HOLS
public static final boolean Init(java.lang.String strCalendarSetLoc)
strCalendarSetLoc
- The calendar setpublic static final java.util.Set<java.lang.String> GetHolLocations()
public static final int[] GetWeekendDays(java.lang.String strCalendarSet)
strCalendarSet
- Holiday calendar setpublic static final java.lang.String GetAvailableDC()
public static final double YearFraction(double dblStart, double dblEnd, java.lang.String strDayCount, boolean bApplyEOMAdj, double dblMaturity, ActActDCParams actactParams, java.lang.String strCalendar) throws java.lang.Exception
dblStart
- Start DatedblEnd
- End DatestrDayCount
- Day count conventionbApplyEOMAdj
- Apply end-of-month adjustment (true)dblMaturity
- Maturity DateactactParams
- ActActParamsstrCalendar
- Holiday Calendarjava.lang.Exception
- Thrown if the accrual fraction cannot be calculatedpublic static final double RollDate(double dblDate, int iRollMode, java.lang.String strCalendarSet) throws java.lang.Exception
dblDate
- Date to be rollediRollMode
- Roll Mode (one of DR_ACT, DR_FOLL, DR_MOD_FOLL, DR_PREV, or DR_MOD_PREV)strCalendarSet
- Calendar Set to calculate the holidays byjava.lang.Exception
- Thrown if the date cannot be rolledpublic static final boolean IsHoliday(double dblDate, java.lang.String strCalendar, int iHolType) throws java.lang.Exception
dblDate
- DatestrCalendar
- Location Calendar setiHolType
- WEEKDAY_HOLS or WEEKEND_HOLSjava.lang.Exception
- Thrown if it cannot be evaluatedpublic static final boolean IsHoliday(double dblDate, java.lang.String strCalendar) throws java.lang.Exception
dblDate
- DatestrCalendar
- Location Calendar setjava.lang.Exception
- Thrown if it cannot be evaluatedpublic static final int BusDays(double dblStart, double dblFinish, java.lang.String strCalendar) throws java.lang.Exception
dblStart
- Start DatedblFinish
- End DatestrCalendar
- Holiday Calendar setjava.lang.Exception
- Thrown if it cannot be evaluatedpublic static final java.util.List<java.lang.Double> HolidaySet(double dblStart, double dblFinish, java.lang.String strCalendar)
dblStart
- Start DatedblFinish
- End DatestrCalendar
- Holiday Calendar setjava.lang.Exception
- Thrown if it cannot be evaluatedpublic static final int Holidays(double dblStart, double dblFinish, java.lang.String strCalendar) throws java.lang.Exception
dblStart
- Start DatedblFinish
- End DatestrCalendar
- Holiday Calendar setjava.lang.Exception
- Thrown if it cannot be evaluatedpublic static final double Adjust(double dblDate, java.lang.String strCalendar, int iAdjustMode) throws java.lang.Exception
dblDate
- Date to be rolledstrCalendar
- Calendar Set to calculate the holidays byiAdjustMode
- Adjustment Mode (one of DR_ACT, DR_FOLL, DR_MOD_FOLL, DR_PREV, or DR_MOD_PREVjava.lang.Exception
- Thrown if the date cannot be adjustedpublic static final double AddBusinessDays(double dblDate, int iNumDays, java.lang.String strCalendar) throws java.lang.Exception
dblDate
- Date to be rollediNumDays
- Number of days to addstrCalendar
- Calendar Set to calculate the holidays byjava.lang.Exception
- Propogated if exception encounteredpublic static void main(java.lang.String[] astrArgs) throws java.lang.Exception
java.lang.Exception