@Override public LocalDate adjust(LocalDate date, HolidayCalendar calendar) { return ArgChecker.notNull(date, "date"); } },
/** * Constructor with cap pricer and reference data. * * @param pricer the cap pricer * @param referenceData the reference data */ public IborCapletFloorletVolatilityCalibrator(VolatilityIborCapFloorLegPricer pricer, ReferenceData referenceData) { this.pricer = ArgChecker.notNull(pricer, "pricer"); this.referenceData = ArgChecker.notNull(referenceData, "referenceData"); }
/** * Creates an instance. * * @param futurePricer the pricer for {@link ResolvedBondFutureOption} */ public BlackBondFutureOptionMarginedProductPricer( DiscountingBondFutureProductPricer futurePricer) { this.futurePricer = ArgChecker.notNull(futurePricer, "futurePricer"); }
/** * Creates an instance. * * @param productPricer the pricer for {@link ResolvedBill} * @param paymentPricer the pricer for {@link Payment} */ public DiscountingBillTradePricer( DiscountingBillProductPricer productPricer, DiscountingPaymentPricer paymentPricer) { this.productPricer = ArgChecker.notNull(productPricer, "productPricer"); this.paymentPricer = ArgChecker.notNull(paymentPricer, "paymentPricer"); }
/** * Creates an instance. * * @param capFloorLegPricer the pricer for {@link IborCapFloorLeg} * @param payLegPricer the pricer for {@link SwapLeg} */ public VolatilityIborCapFloorProductPricer( VolatilityIborCapFloorLegPricer capFloorLegPricer, DiscountingSwapLegPricer payLegPricer) { this.capFloorLegPricer = ArgChecker.notNull(capFloorLegPricer, "capFloorLegPricer"); this.payLegPricer = ArgChecker.notNull(payLegPricer, "payLegPricer"); }
/** * Creates an instance. * * @param type the enum type * @param children the child extended enums to delegate to */ private CombinedExtendedEnum( Class<T> type, ImmutableList<ExtendedEnum<? extends T>> children) { this.type = ArgChecker.notNull(type, "type"); this.children = ArgChecker.notNull(children, "children"); }
/** * Creates an instance. * * @param productPricer the pricer for {@link ResolvedFixedCouponBond} * @param paymentPricer the pricer for {@link Payment} */ public DiscountingFixedCouponBondTradePricer( DiscountingFixedCouponBondProductPricer productPricer, DiscountingPaymentPricer paymentPricer) { this.productPricer = ArgChecker.notNull(productPricer, "productPricer"); this.paymentPricer = ArgChecker.notNull(paymentPricer, "paymentPricer"); }
/** * Creates an instance. * * @param periodPricer the pricer for {@link FixedCouponBondPaymentPeriod} * @param nominalPricer the pricer for {@link Payment} */ public DiscountingFixedCouponBondProductPricer( DiscountingFixedCouponBondPaymentPeriodPricer periodPricer, DiscountingPaymentPricer nominalPricer) { this.nominalPricer = ArgChecker.notNull(nominalPricer, "nominalPricer"); this.periodPricer = ArgChecker.notNull(periodPricer, "periodPricer"); }
/** * Creates an instance. * * @param bondPricer the pricer for {@link ResolvedFixedCouponBond}. */ public DiscountingBondFutureProductPricer(DiscountingFixedCouponBondProductPricer bondPricer) { this.bondPricer = ArgChecker.notNull(bondPricer, "bondPricer"); }
/** * Creates an instance. * * @param cmsProductPricer the pricer for {@link ResolvedCms} * @param paymentPricer the pricer for {@link Payment} */ public SabrExtrapolationReplicationCmsTradePricer( SabrExtrapolationReplicationCmsProductPricer cmsProductPricer, DiscountingPaymentPricer paymentPricer) { this.productPricer = ArgChecker.notNull(cmsProductPricer, "cmsProductPricer"); this.paymentPricer = ArgChecker.notNull(paymentPricer, "paymentPricer"); }
@Override public LocalDate adjust(LocalDate baseDate, Period period, HolidayCalendar calendar) { ArgChecker.notNull(baseDate, "baseDate"); ArgChecker.notNull(period, "period"); ArgChecker.notNull(calendar, "calendar"); LocalDate endDate = baseDate.plus(period); if (calendar.isLastBusinessDayOfMonth(baseDate)) { return calendar.lastBusinessDayOfMonth(endDate); } return endDate; }
@Override public double relativeTime(ZonedDateTime dateTime) { ArgChecker.notNull(dateTime, "dateTime"); LocalDate valuationDate = valuationDateTime.toLocalDate(); LocalDate date = dateTime.toLocalDate(); return dayCount.relativeYearFraction(valuationDate, date); }
@Override public LocalDateDoubleTimeSeries mapDates(Function<? super LocalDate, ? extends LocalDate> mapper) { ArgChecker.notNull(mapper, "mapper"); LocalDate[] dates = Arrays.stream(this.dates).map(mapper).toArray(size -> new LocalDate[size]); // Check the dates are still in ascending order after the mapping Arrays.stream(dates).reduce(this::checkAscending); return createUnsafe(dates, values); }
/** * Checks if this property set contains the specified key. * * @param key the key name * @return true if the key exists */ public boolean contains(String key) { ArgChecker.notNull(key, "key"); return keyValueMap.containsKey(key); }
@Override public void forEach(ObjDoubleConsumer<LocalDate> action) { ArgChecker.notNull(action, "action"); for (int i = 0; i < size(); i++) { action.accept(dates[i], values[i]); } }
public static ComplexNumber exp(ComplexNumber z) { ArgChecker.notNull(z, "z"); double mult = Math.exp(z.getReal()); return new ComplexNumber(mult * Math.cos(z.getImaginary()), mult * Math.sin(z.getImaginary())); }
/** * Returns the principal value of log, with z the principal argument of z defined to lie in the interval (-pi, pi]. * @param z ComplexNumber * @return The log */ public static ComplexNumber log(ComplexNumber z) { ArgChecker.notNull(z, "z"); return new ComplexNumber(Math.log(Math.hypot(z.getReal(), z.getImaginary())), Math.atan2(z.getImaginary(), z.getReal())); }
/** * Obtains an instance from the specified unique name. * * @param uniqueName the unique name * @return the parser * @throws IllegalArgumentException if the name is not known */ @FromString public static FpmlParserPlugin of(String uniqueName) { ArgChecker.notNull(uniqueName, "uniqueName"); return extendedEnum().lookup(uniqueName); }
/** * Creates an instance. * * @param swapPricer the pricer for {@link Swap} */ public DiscountingCmsProductPricer(DiscountingSwapProductPricer swapPricer) { this.swapPricer = ArgChecker.notNull(swapPricer, "swapPricer"); this.cmsLegPricer = new DiscountingCmsLegPricer(new DiscountingCmsPeriodPricer(swapPricer)); }
@Override public LocalDate adjust(LocalDate date) { ArgChecker.notNull(date, "date"); return date.withDayOfMonth(9).with(TemporalAdjusters.nextOrSame(DayOfWeek.WEDNESDAY)); } },