/** * Calculates the maturity date from the effective date. * <p> * The effective date is the date on which the implied deposit starts. * The maturity date is the date on which the implied deposit ends. * <p> * No error is thrown if the input date is not a valid effective date. * Instead, the effective date is moved to the next valid effective date and then processed. * * @param effectiveDate the effective date * @return the maturity date */ public default LocalDate calculateMaturityFromEffective(LocalDate effectiveDate) { return getFixingCalendar().shift(getFixingCalendar().nextOrSame(effectiveDate), 1); }
/** * Calculates the effective date from the fixing date. * <p> * The fixing date is the date on which the index is to be observed. * The effective date is the date on which the implied deposit starts. * <p> * No error is thrown if the input date is not a valid fixing date. * Instead, the fixing date is moved to the next valid fixing date and then processed. * * @param fixingDate the fixing date * @return the effective date */ public default LocalDate calculateEffectiveFromFixing(LocalDate fixingDate) { return getFixingCalendar().shift(getFixingCalendar().nextOrSame(fixingDate), getIndex().getEffectiveDateOffset()); }
/** * Calculates the publication date from the fixing date. * <p> * The fixing date is the date on which the index is to be observed. * The publication date is the date on which the fixed rate is actually published. * <p> * No error is thrown if the input date is not a valid fixing date. * Instead, the fixing date is moved to the next valid fixing date and then processed. * * @param fixingDate the fixing date * @return the publication date */ public default LocalDate calculatePublicationFromFixing(LocalDate fixingDate) { return getFixingCalendar().shift(getFixingCalendar().nextOrSame(fixingDate), getIndex().getPublicationDateOffset()); }
/** * Calculates the maturity date from the fixing date. * <p> * The fixing date is the date on which the index is to be observed. * The maturity date is the date on which the implied deposit ends. * <p> * No error is thrown if the input date is not a valid fixing date. * Instead, the fixing date is moved to the next valid fixing date and then processed. * * @param fixingDate the fixing date * @return the maturity date */ public default LocalDate calculateMaturityFromFixing(LocalDate fixingDate) { return getFixingCalendar().shift(getFixingCalendar().nextOrSame(fixingDate), getIndex().getEffectiveDateOffset() + 1); }
/** * Calculates the fixing date from the effective date. * <p> * The fixing date is the date on which the index is to be observed. * The effective date is the date on which the implied deposit starts. * <p> * No error is thrown if the input date is not a valid effective date. * Instead, the effective date is moved to the next valid effective date and then processed. * * @param effectiveDate the effective date * @return the fixing date */ public default LocalDate calculateFixingFromEffective(LocalDate effectiveDate) { return getFixingCalendar().shift(getFixingCalendar().nextOrSame(effectiveDate), -getIndex().getEffectiveDateOffset()); }