Package org.threeten.bp

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


    ZonedDateTime date = maturityDate;

    // TODO review the tolerance given
    while (date.isAfter(effectiveDate) && DateUtils.getExactDaysBetween(effectiveDate, date) > 4.0) {
      dates.add(date);
      date = date.minus(period);
    }

    Collections.sort(dates);
    return dates.toArray(EMPTY_ARRAY);
  }
View Full Code Here


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

        // Store the date (note this is at the top of the loop)
        cashflowSchedule[i] = cashflowDate;

        // Step back in time by the specified number of months
        cashflowDate = cashflowDate.minus(couponFrequency.getPeriod());
      }

      // TODO : Sort this out

      if (stubType == StubType.FRONTSHORT) {
View Full Code Here

        // Append the timenode at the adjusted effective date at the beginning of the cashflow schedule vector
        cashflowSchedule[0] = adjustedEffectiveDate;
      }

      if (stubType == StubType.FRONTLONG) {
        cashflowSchedule[0] = cashflowDate.minus(couponFrequency.getPeriod());
      }

    }

    // -------------------------------------------------------------------------------
View Full Code Here

      // Step back in time in steps of size determined by the coupon frequency until we get to the first valid date after the adjusted effective date
      while (cashflowDate.isAfter(startDate)) {

        // Step back in time
        cashflowDate = cashflowDate.minus(couponFrequency.getPeriod());

        // Increment the counter
        numberOfCashflows++;
      }
View Full Code Here

    if (stubType == StubType.FRONTSHORT || stubType == StubType.FRONTLONG) {
      final List<ZonedDateTime> reversedCashflowSchedule = new ArrayList<>();
      ZonedDateTime date = endDate;
      while (date.isAfter(startDate)) {
        reversedCashflowSchedule.add(date);
        date = date.minus(cds.getCouponFrequency().getPeriod());
      }
      // TODO : Check the FRONTSHORT/FRONTLONG logic here
      if (reversedCashflowSchedule.size() == 1 || date.isEqual(startDate) || stubType == StubType.FRONTSHORT) {
        reversedCashflowSchedule.add(startDate);
      } else {
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.