<p>Additionsmethode. </p>

@param   unit        calendar unit
@param   context     calendar date
@param   amount      amount to be added
@param   policy      overflow policy
@return  result of addition
18891
static PlainDate doAdd(
        CalendarUnit unit,
        PlainDate context,
        long amount,
        int policy
    ) {

        switch (unit) {
            case MILLENNIA:
                return doAdd(
                    CalendarUnit.MONTHS,
                    context,
                    MathUtils.safeMultiply(amount, 12 * 1000),
                    policy);
            case CENTURIES:
                return doAdd(
                    CalendarUnit.MONTHS,
                    context,
                    MathUtils.safeMultiply(amount, 12 * 100),
                    policy);
            case DECADES:
                return doAdd(
                    CalendarUnit.MONTHS,
                    context,
                    MathUtils.safeMultiply(amount, 12 * 10),
                    policy);
            case YEARS:
                return doAdd(
                    CalendarUnit.MONTHS,
                    context,
                    MathUtils.safeMultiply(amount, 12),
                    policy);
            case QUARTERS:
                return doAdd(
                    CalendarUnit.MONTHS,
                    context,
                    MathUtils.safeMultiply(amount, 3),
                    policy);
            case MONTHS:
                long months =
                    MathUtils.safeAdd(context.getEpochMonths(), amount);
                return PlainDate.fromEpochMonths(
                    context,
                    months,
                    context.dayOfMonth,
                    policy);
            case WEEKS:
                return doAdd(
                    CalendarUnit.DAYS,
                    context,
                    MathUtils.safeMultiply(amount, 7),
                    policy);
            case DAYS:
                return addDays(context, amount);
            default:
                throw new UnsupportedOperationException(unit.name());
        }

    }
1134549
public static Date add(String date, int field, int amount) throws ParseException {
        return add(Formatter.stringToDatetime(date), field, amount);
    }
301699
@Override
    public MonetaryAmount apply(MonetaryAmount amount) {
        return amount.getFactory().setCurrency(amount.getCurrency()).setNumber(
                amount.getNumber().numberValue(BigDecimal.class)
                        .setScale(this.context.getInt(SCALE_KEY), this.context.get(RoundingMode.class))).create();
    }
1011343
public long add(long instant, int amount) {
        instant = super.add(instant, amount);
        FieldUtils.verifyValueBounds(this, get(instant), iMin, iMax);
        return instant;
    }
1181459
function ToDate(amount, unit, method) {
  this.amount = amount;
  this.method = method;
  this.unit = unit;
}
161071
public static <D extends Comparable> DateTimeExpression<D> dateadd(DatePart unit, DateTimeExpression<D> date, int amount) {
        return Expressions.dateTimeOperation(date.getType(), DATE_ADD_OPS.get(unit), date, ConstantImpl.create(amount));
    }
1348209
public Boolean Add( CalendarPeriodAssociative<T> period, AddFunction<T> addFunction )
	{
		// combine les deux tableaux dans ordre croissant
		List<PeriodAssociative<T>> combined = _Combine( periods, period.getPeriods() );

		// merge overlapping periods
		List<PeriodAssociative<T>> result = _Merge( combined, addFunction );
		if( result == null )
			return null; // we should stop the MakeUpCalendarAssociative process

		periods = result;

		// to say we can continue...
		return true;
	}
50645
public void add(int field, int amount) {
        switch (field) {
        case MONTH:
            if (amount != 0) {
                int dom = get(DAY_OF_MONTH);
                int day = get(JULIAN_DAY) - EPOCH_JULIAN_DAY; // Get local day
                int moon = day - dom + 1; // New moon 
                offsetMonth(moon, dom, amount);
            }
            break;
        default:
            super.add(field, amount);
            break;
        }
    }
873997
public static Date addHour(Date date, int amount) {
        return add(date, Calendar.HOUR, amount);
    }
945959
public boolean addFlowElement(MapElement fe) {
		if (fe instanceof ExceptionHandler) {
			exceptionHandler = (ExceptionHandler) fe;
			return true;
		} else if (fe instanceof InvocationResultExpression) {
			if (results == null) {
				results = new ArrayList();
			}
			results.add(fe);
			return true;
		}
		return false;
	}
342268
public void add(Date date) {
    final Calendar cal = Calendar.getInstance();
    cal.setTime(date);
    add(cal);
    date.setTime(cal.getTime().getTime());
  }
556982
@Override
    public void addTo(CommandContext ctx, ModelNode headers) throws CommandFormatException {

        if(planRef != null) {
/*            final OperationRequestHeader rolloutPlan = ctx.getConfig().getRolloutPlan(planRef);
            if(rolloutPlan == null) {
                throw new CommandFormatException("Rollout plan with id '" + planRef + "' could not be found.");
            }
            rolloutPlan.addTo(ctx, headers);
*/
            ModelNode rolloutPlan = Util.getRolloutPlan(ctx.getModelControllerClient(), planRef);
            headers.set(rolloutPlan);
            return;
        }
        ModelNode header = headers.get(Util.ROLLOUT_PLAN);
        final ModelNode series = header.get(Util.IN_SERIES);
        for(RolloutPlanGroup group : groups) {
            group.addTo(series);
        }

        if(props != null) {
            for(String propName : props.keySet()) {
                header.get(propName).set(props.get(propName));
            }
        }
    }
688341
@Override
	public MonetaryAmount apply(MonetaryAmount amount) {
		Objects.requireNonNull(amount, "Amount required.");
		return amount.multiply(permilValue);
	}
1290904
public static <D extends Comparable> DateExpression<D> dateadd(DatePart unit, DateExpression<D> date, int amount) {
        return Expressions.dateOperation(date.getType(), DATE_ADD_OPS.get(unit), date, ConstantImpl.create(amount));
    }
615934
public static long plus(long packedDateTime, long amountToAdd, TemporalUnit unit) {

        LocalDateTime dateTime = asLocalDateTime(packedDateTime);
        return pack(dateTime.plus(amountToAdd, unit));
    }
270616
public static Date addMinute(String date, int amount) throws ParseException {
        return add(date, Calendar.MINUTE, amount);
    }
276066
public static int addExact(int a, int b) {
        long result = (long) a + b;
        checkNoOverflow(result == (int) result);
        return (int) result;
    }