// creates an observation private FxIndexObservation create(LocalDate fixingDate, HolidayCalendar fixingCal, DateAdjuster maturityAdjuster) { LocalDate fixingBusinessDay = fixingCal.nextOrSame(fixingDate); LocalDate maturityDate = maturityAdjuster.adjust(fixingBusinessDay); return(new FxIndexObservation(this, fixingDate, maturityDate)); }
//------------------------------------------------------------------------- public LocalDate calculateMaturityFromFixing(LocalDate fixingDate, ReferenceData refData) { // handle case where the input date is not a valid fixing date HolidayCalendar fixingCal = fixingCalendar.resolve(refData); LocalDate fixingBusinessDay = fixingCal.nextOrSame(fixingDate); // find the maturity date using the offset and calendar in DaysAdjustment return(maturityDateOffset.adjust(fixingBusinessDay, refData)); }
public LocalDate calculateMaturityFromEffective(LocalDate effectiveDate, ReferenceData refData) { HolidayCalendar fixingCal = fixingCalendar.resolve(refData); return(fixingCal.shift(fixingCal.nextOrSame(effectiveDate), 1)); }
public LocalDate calculateEffectiveFromFixing(LocalDate fixingDate, ReferenceData refData) { HolidayCalendar fixingCal = fixingCalendar.resolve(refData); return(fixingCal.shift(fixingCal.nextOrSame(fixingDate), effectiveDateOffset)); }