Examples of minusMonths()


Examples of org.threeten.bp.ZonedDateTime.minusMonths()

    if (fromEnd) {
      ZonedDateTime date = endDate;
      int i = 1;
      while (!date.isBefore(startDate)) {
        dates.add(date);
        date = generateRecursive ? date.minusMonths(1) : endDate.minusMonths(i++);
      }
      Collections.reverse(dates);
      return dates.toArray(EMPTY_ZONED_DATE_TIME_ARRAY);
    }
    ZonedDateTime date = startDate;
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.minusMonths()

    int monthLag = 3;
    double[] nodeTimeOther = new double[swapTenor.length];
    ZonedDateTime[] referenceDate = new ZonedDateTime[swapTenor.length];
    for (int loopswap = 0; loopswap < swapTenor.length; loopswap++) {
      ZonedDateTime paymentDate = ScheduleCalculator.getAdjustedDate(constructionDate, Period.ofYears(swapTenor[loopswap]), BUSINESS_DAY, CALENDAR);
      referenceDate[loopswap] = paymentDate.minusMonths(monthLag).withDayOfMonth(1);
      nodeTimeOther[loopswap] = ACT_ACT.getDayCountFraction(constructionDate, referenceDate[loopswap]);
    }
    PriceIndexCurve priceIndexCurve = PriceIndexCurve.fromStartOfMonth(nodeTimeKnown, indexKnown, nodeTimeOther, swapRate);
    for (int loopswap = 0; loopswap < swapTenor.length; loopswap++) {
      assertEquals("Simple price curve", indexKnown[0] * Math.pow(1 + swapRate[loopswap], swapTenor[loopswap]), priceIndexCurve.getPriceIndex(nodeTimeOther[loopswap]));
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.minusMonths()

    market.setCurve(ISSUER_UK_GOVT, Currency.GBP, CURVE_GBP_30);
    market.setCurve(ISSUER_US_GOVT, Currency.GBP, CURVE_USD_30);
    final ZonedDateTime spotUs = ScheduleCalculator.getAdjustedDate(pricingDate, SPOT_LAG_US, CALENDAR_USD);
    final ZonedDateTime referenceInterpolatedDate = spotUs.minusMonths(MONTH_LAG_US);
    final ZonedDateTime[] referenceDate = new ZonedDateTime[2];
    referenceDate[0] = referenceInterpolatedDate.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
    referenceDate[1] = referenceDate[0].plusMonths(1).with(TemporalAdjusters.lastDayOfMonth());
    final int[] yearUs = new int[] {1, 5, 10, 20, 50 };
    final double[] indexValueUs = new double[2 + 2 * yearUs.length];
    final double[] timeValueUs = new double[2 + 2 * yearUs.length];
    indexValueUs[0] = USCPI_TIME_SERIES.getValue(referenceDate[0]);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.