Package org.threeten.bp

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


        curveNodes.put(curveName, nodeTimes.toDoubleArray());
        interpolators.put(curveName, interpolator);
      }
      if (marketValues.size() != totalStrips) {
        s_logger.info("Could not get market values for {}", valuationDate);
        valuationDate = valuationDate.plusDays(1);
        continue;
      }
      try {
        final MultipleYieldCurveFinderDataBundle data = new MultipleYieldCurveFinderDataBundle(derivatives, marketValues.toDoubleArray(), knownCurves, curveNodes, interpolators, useFiniteDifference,
            new FXMatrix(currency));
View Full Code Here


            dateCurveMap.put(valuationDate, yieldCurve);
            curveSeries.put(curveName, dateCurveMap);
          }
          i += offset;
        }
        valuationDate = valuationDate.plusDays(1);
      } catch (final Exception e) {
        s_logger.error("Could not fit curve on {}", valuationDate);
        valuationDate = valuationDate.plusDays(1);
        continue;
      }
View Full Code Here

          i += offset;
        }
        valuationDate = valuationDate.plusDays(1);
      } catch (final Exception e) {
        s_logger.error("Could not fit curve on {}", valuationDate);
        valuationDate = valuationDate.plusDays(1);
        continue;
      }
    }
    for (final String curveName : curveNames) {
      final ValueProperties curveProperties = commonProperties.with(CURVE, curveName).get();
View Full Code Here

      if (holidayCalendar.isWorkingDay(date)) {
        nBusinessDays--;
      }
    }
    // If day is a Friday or immediately precedes a holiday (e.g. a Friday) it moves to the previous business day
    if (!holidayCalendar.isWorkingDay(date.plusDays(1))) {
      date = date.minusDays(1);
      while (!holidayCalendar.isWorkingDay(date)) {
        date = date.minusDays(1);
      }
    }
View Full Code Here

        while (!holidayCalendar.isWorkingDay(lastFridayOfMonth)) {
          lastFridayOfMonth = lastFridayOfMonth.minusDays(1);
        }
        return lastFridayOfMonth;
      }
      date = date.plusDays(1);
    }
    LocalDate result = lastFridayOfMonth.with(PREVIOUS_FRIDAY_ADJUSTER);
    while (!holidayCalendar.isWorkingDay(result)) {
      result = result.minusDays(1);
    }
View Full Code Here

      existingSeries = ImmutableLocalDateDoubleTimeSeries.EMPTY_SERIES;
    }

    // Filter points by date range and max points to return
    // Heeds LocalDateDoubleTimeSeries convention: inclusive start, exclusive end
    LocalDateDoubleTimeSeries subSeries = existingSeries.subSeries(fromDateInclusive, toDateInclusive.plusDays(1));
    Integer maxPoints = filter.getMaxPoints();
    if (((maxPoints != null) && (Math.abs(maxPoints) < subSeries.size()))) {
      subSeries = maxPoints >= 0 ? subSeries.head(maxPoints) : subSeries.tail(-maxPoints);
    }
View Full Code Here

    bld.put(current, Math.random());
    while (bld.size() < numDays) {
      if (isWeekday(current)) {
        bld.put(current, Math.random());
      }
      current = current.plusDays(1);
    }
    return bld.build();
  }

  /**
 
View Full Code Here

  // -------- PRIVATE SUBROUTINES --------
  private LocalDate determineTargetExpiry(LocalDate referenceDate, int monthsFromReferenceDate) {
    LocalDate result = referenceDate.plusMonths(monthsFromReferenceDate);
    result = LocalDate.of(result.getYear(), result.getMonth(), 1);
    while (!(result.getDayOfWeek() == FRIDAY)) {
      result = result.plusDays(1);
    }
    result = result.plusDays(15); // Saturday after third Friday
   
    // Fencepost condition: if we are looking 0 months ahead, but the referenceDate is past the
    // the Saturday after third Friday, then move forward 1 month
View Full Code Here

    LocalDate result = referenceDate.plusMonths(monthsFromReferenceDate);
    result = LocalDate.of(result.getYear(), result.getMonth(), 1);
    while (!(result.getDayOfWeek() == FRIDAY)) {
      result = result.plusDays(1);
    }
    result = result.plusDays(15); // Saturday after third Friday
   
    // Fencepost condition: if we are looking 0 months ahead, but the referenceDate is past the
    // the Saturday after third Friday, then move forward 1 month
    if (monthsFromReferenceDate == 0 && result.isBefore(referenceDate)) {
      result = determineTargetExpiry(referenceDate, 1);
View Full Code Here

        while (!holidayCalendar.isWorkingDay(expiryDate)) {
          expiryDate = expiryDate.minusDays(1);
        }
        return expiryDate;
      }
      date = date.plusDays(1);
    }
    LocalDate result = expiryDate.with(PREVIOUS_FRIDAY_ADJUSTER);
    while (!holidayCalendar.isWorkingDay(result)) {
      result = result.minusDays(1);
    }
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.