Package org.threeten.bp

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


    }
    final List<ZonedDateTime> dates = new ArrayList<>();
    ZonedDateTime date = startDate.with(TemporalAdjusters.lastDayOfMonth());
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plus(Period.ofMonths(1)).with(TemporalAdjusters.lastDayOfMonth());
    }
    return dates.toArray(EMPTY_ZONED_DATE_TIME_ARRAY);
  }
}
View Full Code Here


      throw new IllegalArgumentException("For the moment can only deal with PeriodFrequency and SimpleFrequency");
    }
    final Period period = periodFrequency.getPeriod();
    final List<ZonedDateTime> dates = new ArrayList<>();
    ZonedDateTime date = effectiveDate; // TODO this is only correct if effective date = accrual date
    date = date.plus(period);
    while (isWithinSwapLifetime(date, maturityDate)) { // REVIEW: could speed this up by working out how many periods between start and end date?
      dates.add(date);
      date = date.plus(period);
    }
    return dates.toArray(EMPTY_ARRAY);
View Full Code Here

    final List<ZonedDateTime> dates = new ArrayList<>();
    ZonedDateTime date = effectiveDate; // TODO this is only correct if effective date = accrual date
    date = date.plus(period);
    while (isWithinSwapLifetime(date, maturityDate)) { // REVIEW: could speed this up by working out how many periods between start and end date?
      dates.add(date);
      date = date.plus(period);
    }
    return dates.toArray(EMPTY_ARRAY);
  }

  //TODO: add doc
View Full Code Here

    // TODO what if there's no valid date between accrual date and maturity date?
    final List<ZonedDateTime> dates = new ArrayList<>();
    int nbPeriod = 1; // M 26-Aug
    ZonedDateTime date = effectiveDate; // TODO this is only correct if effective date = accrual date
    date = date.plus(period);
    while (isWithinSwapLifetime(date, maturityDate)) { // REVIEW: could speed this up by working out how many periods between start and end date?
      dates.add(date);
      nbPeriod++; // M 26-Aug
      date = effectiveDate.plus(period.multipliedBy(nbPeriod)); // M 26-Aug date = date.plus(period);
    }
View Full Code Here

    BusinessDayConvention actualBDC;
    final List<ZonedDateTime> adjustedDates = new ArrayList<>();
    ZonedDateTime date = startDate;
    if (eomApply) {
      actualBDC = new PrecedingBusinessDayConvention(); //To ensure that the date stays in the current month.
      date = date.plus(period).with(TemporalAdjusters.lastDayOfMonth());
      while (date.isBefore(endDate)) { // date is strictly before endDate
        adjustedDates.add(actualBDC.adjustDate(calendar, date));
        date = date.plus(period).with(TemporalAdjusters.lastDayOfMonth());
      }
    } else {
View Full Code Here

    if (eomApply) {
      actualBDC = new PrecedingBusinessDayConvention(); //To ensure that the date stays in the current month.
      date = date.plus(period).with(TemporalAdjusters.lastDayOfMonth());
      while (date.isBefore(endDate)) { // date is strictly before endDate
        adjustedDates.add(actualBDC.adjustDate(calendar, date));
        date = date.plus(period).with(TemporalAdjusters.lastDayOfMonth());
      }
    } else {
      actualBDC = businessDayConvention;
      date = date.plus(period);
      while (date.isBefore(endDate)) { // date is strictly before endDate
View Full Code Here

        adjustedDates.add(actualBDC.adjustDate(calendar, date));
        date = date.plus(period).with(TemporalAdjusters.lastDayOfMonth());
      }
    } else {
      actualBDC = businessDayConvention;
      date = date.plus(period);
      while (date.isBefore(endDate)) { // date is strictly before endDate
        adjustedDates.add(businessDayConvention.adjustDate(calendar, date));
        date = date.plus(period);
      }
    }
View Full Code Here

    } else {
      actualBDC = businessDayConvention;
      date = date.plus(period);
      while (date.isBefore(endDate)) { // date is strictly before endDate
        adjustedDates.add(businessDayConvention.adjustDate(calendar, date));
        date = date.plus(period);
      }
    }
    // For long stub the last date before end date, if any, is removed.
    if (!stubShort && adjustedDates.size() >= 1) {
      adjustedDates.remove(adjustedDates.size() - 1);
View Full Code Here

    }
    ZonedDateTime date = startDate;
    int i = 1;
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = generateRecursive ? date.plus(Period.ofYears(1)) : startDate.plus(Period.ofYears(i++));
    }
    return dates.toArray(EMPTY_ZONED_DATE_TIME_ARRAY);
  }

}
View Full Code Here

  @Override
  public CompiledFunctionDefinition compile(final FunctionCompilationContext context, final Instant atInstant) {
    final ZonedDateTime atZDT = ZonedDateTime.ofInstant(atInstant, ZoneOffset.UTC);
    final ConfigSource configSource = OpenGammaCompilationContext.getConfigSource(context);
    final CurveDefinitionSource curveDefinitionSource = new ConfigDBCurveDefinitionSource(configSource);
    final Instant versionTime = atZDT.plus(1, ChronoUnit.HOURS).truncatedTo(ChronoUnit.HOURS).toInstant();
    final CurveDefinition curveDefinition = curveDefinitionSource.getCurveDefinition(_curveName, VersionCorrection.of(versionTime, versionTime));
    if (curveDefinition == null) {
      throw new OpenGammaRuntimeException("Could not get curve definition called " + _curveName);
    }
    final ValueProperties properties = createValueProperties()
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.