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

Method plus

base/src/main/java/net/time4j/PlainTime.java:1389–1408  ·  view source on GitHub ↗
(
        long amount,
        ClockUnit unit
    )

Source from the content-addressed store, hash-verified

1387 * @since 4.19
1388 */
1389 public PlainTime plus(
1390 long amount,
1391 ClockUnit unit
1392 ) {
1393
1394 if (unit == null) {
1395 throw new NullPointerException("Missing unit.");
1396 } else if (amount == 0) {
1397 return this;
1398 }
1399
1400 try {
1401 return ClockUnitRule.doAdd(PlainTime.class, unit, this, amount);
1402 } catch (IllegalArgumentException iae) {
1403 ArithmeticException ex = new ArithmeticException("Result beyond boundaries of time axis.");
1404 ex.initCause(iae);
1405 throw ex;
1406 }
1407
1408 }
1409
1410 /**
1411 * <p>Subtracts given amount in units from this clock time and yields the result of subtraction. </p>

Callers 11

normalizeMethod · 0.95
decimalRoundTripMethod · 0.95
nowTimeMethod · 0.95
stream4Method · 0.95
streamSizeLimitMethod · 0.95
streamOverflowMethod · 0.95
dhakaInDSTbMethod · 0.95
ofMethod · 0.95
minusMethod · 0.95
getDurationMethod · 0.95

Calls 1

doAddMethod · 0.95

Tested by 7

normalizeMethod · 0.76
decimalRoundTripMethod · 0.76
nowTimeMethod · 0.76
stream4Method · 0.76
streamSizeLimitMethod · 0.76
streamOverflowMethod · 0.76
dhakaInDSTbMethod · 0.76