Lines Matching refs:amountToAdd
703 * @param amountToAdd the amount to add, measured in terms of the unit, positive or negative
709 public Duration plus(long amountToAdd, TemporalUnit unit) {
712 return plus(Math.multiplyExact(amountToAdd, SECONDS_PER_DAY), 0);
717 if (amountToAdd == 0) {
722 case NANOS: return plusNanos(amountToAdd);
723 case MICROS: return plusSeconds((amountToAdd / (1000_000L * 1000)) * 1000).plusNanos((amountToAdd % (1000_000L * 1000)) * 1000);
724 case MILLIS: return plusMillis(amountToAdd);
725 case SECONDS: return plusSeconds(amountToAdd);
727 return plusSeconds(Math.multiplyExact(unit.getDuration().seconds, amountToAdd));
729 Duration duration = unit.getDuration().multipliedBy(amountToAdd);