Package org.threeten.bp

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


    if (fromEnd) {
      LocalDate 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_LOCAL_DATE_ARRAY);
    }
    LocalDate date = startDate;
View Full Code Here


  public static final String getQuarterlyExpiryCodeForFutures(final String futurePrefix, final int nthFuture, final LocalDate curveDate) {
    //Year convention for historical data is specific to the futurePrefix
    final LocalDate twoDigitYearSwitch;
    final LocalDate today = LocalDate.now(OpenGammaClock.getInstance());
    if (futurePrefix.equals("ED")) {
      twoDigitYearSwitch = today.minus(Period.ofDays(2));
    } else {
      twoDigitYearSwitch = today.minus(Period.ofMonths(11)).minus(Period.ofDays(2));
    }
    return getQuarterlyExpiryMonthYearCode(nthFuture, curveDate, twoDigitYearSwitch);
  }
View Full Code Here

    final LocalDate twoDigitYearSwitch;
    final LocalDate today = LocalDate.now(OpenGammaClock.getInstance());
    if (futurePrefix.equals("ED")) {
      twoDigitYearSwitch = today.minus(Period.ofDays(2));
    } else {
      twoDigitYearSwitch = today.minus(Period.ofMonths(11)).minus(Period.ofDays(2));
    }
    return getQuarterlyExpiryMonthYearCode(nthFuture, curveDate, twoDigitYearSwitch);
  }

  /**
 
View Full Code Here

  public static final String getMonthlyExpiryCodeForFutures(final String futurePrefix, final int nthFuture, final LocalDate curveDate) {
    //Year convention for historical data is specific to the futurePrefix
    final LocalDate twoDigitYearSwitch;
    final LocalDate today = LocalDate.now(OpenGammaClock.getInstance());
    if (futurePrefix.equals("ED")) {
      twoDigitYearSwitch = today.minus(Period.ofDays(2));
    } else {
      twoDigitYearSwitch = today.minus(Period.ofMonths(11)).minus(Period.ofDays(2));
    }
    if (futurePrefix.equals("FF")) {
      return getMonthlyExpiryFFMonthYearCode(nthFuture, curveDate, twoDigitYearSwitch);
View Full Code Here

    final LocalDate twoDigitYearSwitch;
    final LocalDate today = LocalDate.now(OpenGammaClock.getInstance());
    if (futurePrefix.equals("ED")) {
      twoDigitYearSwitch = today.minus(Period.ofDays(2));
    } else {
      twoDigitYearSwitch = today.minus(Period.ofMonths(11)).minus(Period.ofDays(2));
    }
    if (futurePrefix.equals("FF")) {
      return getMonthlyExpiryFFMonthYearCode(nthFuture, curveDate, twoDigitYearSwitch);
    }
    return getMonthlyExpiryMonthYearCode(nthFuture, curveDate, twoDigitYearSwitch);
View Full Code Here

   * @return the mutable request, not null
   */
  public static HistoricalTimeSeriesGetFilter ofLatestPoint(Period period) {
    HistoricalTimeSeriesGetFilter request = new HistoricalTimeSeriesGetFilter();
    LocalDate now = LocalDate.now();
    request.setEarliestDate(now.minus(period));
    request.setLatestDate(now);
    request.setMaxPoints(-1);
    return request;
  }

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.