/** * Returns a new array containing the values from this array with the specified amount added. * <p> * The amount is added to each element in this array. * The currency must be the same as the currency of this array. * * @param amount the amount to add * @return a new array containing the values from this array with the specified amount added * @throws IllegalArgumentException if the array and the amount have different currencies */ public CurrencyScenarioArray plus(CurrencyAmount amount) { return CurrencyScenarioArray.of(amounts.plus(amount)); }
/** * Returns a new array containing the values from this array added to the values in the other array. * <p> * The amounts are added to the matching element in this array. * The currency must be the same as the currency of this array. * The arrays must have the same size. * * @param other another array of multiple currency values. * @return a new array containing the values from this array added to the values in the other array * @throws IllegalArgumentException if the arrays have different sizes or different currencies */ public CurrencyScenarioArray plus(CurrencyScenarioArray other) { return CurrencyScenarioArray.of(amounts.plus(other.amounts)); }