MCPcopy Create free account
hub / github.com/MenoData/Time4J / plus

Method plus

base/src/main/java/net/time4j/PlainDate.java:1384–1403  ·  view source on GitHub ↗
(
        long amount,
        CalendarUnit unit
    )

Source from the content-addressed store, hash-verified

1382 * @since 4.18
1383 */
1384 public PlainDate plus(
1385 long amount,
1386 CalendarUnit unit
1387 ) {
1388
1389 if (unit == null) {
1390 throw new NullPointerException("Missing unit.");
1391 } else if (amount == 0) {
1392 return this;
1393 }
1394
1395 try {
1396 return PlainDate.doAdd(unit, this, amount, OverflowUnit.POLICY_PREVIOUS_VALID_DATE);
1397 } catch (IllegalArgumentException iae) {
1398 ArithmeticException ex = new ArithmeticException("Result beyond boundaries of time axis.");
1399 ex.initCause(iae);
1400 throw ex;
1401 }
1402
1403 }
1404
1405 /**
1406 * <p>Subtracts given amount in units from this date and yields the result of subtraction. </p>

Callers 15

isAfterAllMethod · 0.95
betweenWeekBasedMethod · 0.95
reversibleMethod · 0.95
additionMethod · 0.95
jodaMetricMethod · 0.95
plusZeroMethod · 0.95
astronomyMethod · 0.95
williamsLaplandMethod · 0.95
noaaLapland1Method · 0.95
prolepticNumberMethod · 0.95
prolepticNumberMethod · 0.95
businessDays1Method · 0.95

Calls 1

doAddMethod · 0.95

Tested by 15

isAfterAllMethod · 0.76
betweenWeekBasedMethod · 0.76
reversibleMethod · 0.76
additionMethod · 0.76
jodaMetricMethod · 0.76
plusZeroMethod · 0.76
astronomyMethod · 0.76
williamsLaplandMethod · 0.76
noaaLapland1Method · 0.76
prolepticNumberMethod · 0.76
prolepticNumberMethod · 0.76
businessDays1Method · 0.76