@Override public LocalDate adjust(LocalDate date, HolidayCalendar calendar) { return ArgChecker.notNull(date, "date"); } },
/** * Checks if this array equals zero within the specified tolerance. * <p> * This returns true if all the {@code double} values equal zero within the specified tolerance. * * @param tolerance the tolerance * @return true if equal up to the tolerance */ public boolean equalZeroWithTolerance(double tolerance) { return DoubleArrayMath.fuzzyEqualsZero(array, tolerance); }
@Override public T get(int index) { ArgChecker.inRange(index, 0, scenarioCount, "index"); return value; }
public void test_double_inRange_outOfRange() { double low = 0d; double high = 1d; double small = 0.00000000001d; assertThrowsIllegalArg(() -> ArgChecker.inRange(low - small, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRange(high, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRangeInclusive(low - small, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRangeInclusive(high + small, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRangeExclusive(low, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRangeExclusive(high, low, high, "name")); }
public void test_sortPairs_doubledouble_sizeDifferent() { double[] keys = {3d, 2d, 5d, 4d}; double[] values = {6d, 4d}; assertThrowsIllegalArg(() -> DoubleArrayMath.sortPairs(keys, values)); }
public void test_of_validated_invalid() { assertThrowsIllegalArg(() -> SampleValidatedType.of(null)); assertThrowsIllegalArg(() -> SampleValidatedType.of("ABc")); }
public void test_of_invalid() { assertThrowsIllegalArg(() -> SampleType.of(null)); assertThrowsIllegalArg(() -> SampleType.of("")); }
public void test_serialization() { assertSerialization(SampleType.of("A")); }
public void test_jodaConvert() { assertJodaConvert(SampleType.class, SampleType.of("A")); }
/** * 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"); }
public void test_int_inRange_outOfRange() { int low = 0; int high = 1; assertThrowsIllegalArg(() -> ArgChecker.inRange(low - 1, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRange(high, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRangeInclusive(low - 1, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRangeInclusive(high + 1, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRangeExclusive(low, low, high, "name")); assertThrowsIllegalArg(() -> ArgChecker.inRangeExclusive(high, low, high, "name")); }
public void test_sortPairs_doubleObject_sizeDifferent() { double[] keys = {3d, 2d, 5d, 4d}; Integer[] values = {6, 4}; assertThrowsIllegalArg(() -> DoubleArrayMath.sortPairs(keys, values)); }
/** * 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"); }