/*[deutsch]
<p>Rollt dieses zyklische Jahr um den angegebenen Betrag. </p>

@param   amount  determines how many years/units this instance should be rolled
@return  changed copy of this instance
542
public CyclicYear roll(int amount) {

        if (amount == 0) {
            return this;
        }

        return CyclicYear.of(MathUtils.floorModulo(MathUtils.safeAdd(this.year - 1, amount), 60) + 1);

    }
596710
void increment(double amount) {
    if (amount >= 0.0) {
      for (int i = 0; i < ServoPollers.NUM_POLLERS; ++i) {
        add(count.getCurrent(i), amount);
      }
    }
  }
54529
public D plus(int amount) {

        if (amount == 0) {
            return this.self();
        }

        long value = this.amount;
        return this.with(MathUtils.safeCast(value + amount));

    }
719247
public void roll(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 (start of this month)

                // Note throughout the following:  Months 12 and 1 are never
                // followed by a leap month (D&R p. 185).

                // Compute the adjusted month number m.  This is zero-based
                // value from 0..11 in a non-leap year, and from 0..12 in a
                // leap year.
                int m = get(MONTH); // 0-based month
                if (isLeapYear) { // (member variable)
                    if (get(IS_LEAP_MONTH) == 1) {
                        ++m;
                    } else {
                        // Check for a prior leap month.  (In the
                        // following, month 0 is the first month of the
                        // year.)  Month 0 is never followed by a leap
                        // month, and we know month m is not a leap month.
                        // moon1 will be the start of month 0 if there is
                        // no leap month between month 0 and month m;
                        // otherwise it will be the start of month 1.
                        int moon1 = moon -
                            (int) (CalendarAstronomer.SYNODIC_MONTH * (m - 0.5));
                        moon1 = newMoonNear(moon1, true);
                        if (isLeapMonthBetween(moon1, moon)) {
                            ++m;
                        }
                    }
                }

                // Now do the standard roll computation on m, with the
                // allowed range of 0..n-1, where n is 12 or 13.
                int n = isLeapYear ? 13 : 12; // Months in this year
                int newM = (m + amount) % n;
                if (newM < 0) {
                    newM += n;
                }

                if (newM != m) {
                    offsetMonth(moon, dom, newM - m);
                }
            }
            break;
        default:
            super.roll(field, amount);
            break;
        }
    }
365405
@Override
	public MonetaryAmount apply(MonetaryAmount amount) {
		Objects.requireNonNull(amount, "Amount required.");
		return amount.multiply(percentValue);
	}
1016349
public Matrix getMatrixForRepeater(float amount) {
    PointF position = this.position == null ? null : this.position.getValue();
    ScaleXY scale = this.scale == null ? null : this.scale.getValue();

    matrix.reset();
    if (position != null) {
      matrix.preTranslate(position.x * amount, position.y * amount);
    }
    if (scale != null) {
      matrix.preScale(
          (float) Math.pow(scale.getScaleX(), amount),
          (float) Math.pow(scale.getScaleY(), amount));
    }
    if (this.rotation != null) {
      float rotation = this.rotation.getValue();
      PointF anchorPoint = this.anchorPoint == null ? null : this.anchorPoint.getValue();
      matrix.preRotate(rotation * amount, anchorPoint == null ? 0f : anchorPoint.x, anchorPoint == null ? 0f : anchorPoint.y);
    }

    return matrix;
  }
1066642
@Override
    public boolean isLessThan(MonetaryAmount amount) {
        MoneyUtils.checkAmountParameter(amount, currency);
        return number.stripTrailingZeros()
                .compareTo(amount.getNumber().numberValue(BigDecimal.class).stripTrailingZeros()) < 0;
    }
835685
public static BigDecimal strToAmount(@CurrencyAmountStr final String amount) {
        if (amount == null) {
            return null;
        }
        final int dot = amount.indexOf('.');
        final int scale;
        final String unscaledStr;
        if (dot == -1) {
            scale = 0;
            unscaledStr = amount;
        } else {
            scale = amount.length() - dot - 1;
            unscaledStr = amount.substring(0, dot) + amount.substring(dot + 1);
        }
        final BigInteger unscaled = new BigInteger(unscaledStr);
        return new BigDecimal(unscaled, scale);
    }
1246716
public static String formatDouble(final Double amount, String pattern) {
		if (pattern == null || pattern.equals("")) {
			pattern = JKFormatUtil.DEFAULT_DOUBLE_FORMAT;
		}
		return JKFormatUtil.getNumberFormatter(pattern).format(amount);
	}
1368732
@Override
    public MonetaryAmount apply(MonetaryAmount amount) {
        requireNonNull(amount, "Amount required.");
        NumberValue num = amount.getNumber();
        BigDecimal one = ONE.setScale(num.getScale() < 5 ? 5 : num.getScale(), HALF_EVEN);
        BigDecimal reciprocal = one.divide(num.numberValue(BigDecimal.class), HALF_EVEN);
        return amount.getFactory().setNumber(reciprocal).create();
    }
618220
@Override
    public RoundedMoney subtract(MonetaryAmount amount) {
        MoneyUtils.checkAmountParameter(amount, currency);
        if (amount.isZero()) {
            return this;
        }
        return new RoundedMoney(number.subtract(amount.getNumber().numberValue(BigDecimal.class),
                Optional.ofNullable(
                        monetaryContext.get(MathContext.class)).orElse(MathContext.DECIMAL64)),
                currency, rounding);
    }
434525
public static java.sql.Time rollTime(java.util.Date startDate, int period, int amount) {
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(startDate);
        gc.add(period, amount);
        return new java.sql.Time(gc.getTime().getTime());
    }
1210312
static String formatPriceStringUsingFree(long amount, @NonNull Currency currency, String free) {
        if (amount == 0) {
            return free;
        }
        NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
        DecimalFormatSymbols decimalFormatSymbols = ((java.text.DecimalFormat) currencyFormat)
                .getDecimalFormatSymbols();
        decimalFormatSymbols.setCurrencySymbol(currency.getSymbol(Locale.getDefault()));
        ((java.text.DecimalFormat) currencyFormat).setDecimalFormatSymbols(decimalFormatSymbols);

        return formatPriceString(amount, currency);
    }
324282
public final Timestamp addDay(int amount)
    {
        long delta = (long) amount * 24 * 60 * 60 * 1000;
        return addMillisForPrecision(delta, Precision.DAY, false);
    }
461688
public ItemStack extract(int amount)
	{
		ItemStackSplitter iss = new ItemUtils.ItemStackSplitter(getItemStack());
		iss.split(amount);
		setItemStack(iss.source);
		//if (hasChanged())
		onSlotChanged();
		return iss.split;
	}
991390
@Override
    public long get(TemporalUnit unit) {

        for (Map.Entry<IsoUnit, TemporalUnit> entry : MAP.entrySet()) {
            if (entry.getValue().equals(unit)) {
                long amount = this.duration.getPartialAmount(entry.getKey());
                if (this.duration.isNegative()) {
                    amount = Math.negateExact(amount);
                }
                return amount;
            }
        }

        if (unit.equals(ChronoUnit.HALF_DAYS)) {
            long hd = Math.floorDiv(this.duration.getPartialAmount(ClockUnit.HOURS), 12);
            if (this.duration.isNegative()) {
                hd = Math.negateExact(hd);
            }
            return hd;
        }

        throw new UnsupportedTemporalTypeException(unit.toString()); // throws NPE if unit is null

    }
381821
public void record(long amount) {
    if (amount >= 0) {
      totalAmount.increment(amount);
      count.increment();
      max.update(amount);
      min.update(amount);
    }
  }