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

Method add

base/src/main/java/net/time4j/engine/StdOperator.java:443–457  ·  view source on GitHub ↗
(
        TimePoint<U, T> context,
        ChronoElement<?> element,
        boolean forward
    )

Source from the content-addressed store, hash-verified

441
442 // wildcard capture
443 private static <U, T extends TimePoint<U, T>> T add(
444 TimePoint<U, T> context,
445 ChronoElement<?> element,
446 boolean forward
447 ) {
448
449 U unit = context.getChronology().getBaseUnit(element);
450
451 if (forward) {
452 return context.plus(1, unit);
453 } else {
454 return context.minus(1, unit);
455 }
456
457 }
458
459}

Callers 15

moveMethod · 0.95
summingUpMethod · 0.45
getRegisteredElementsMethod · 0.45
getRegisteredElementsMethod · 0.45
summingUpPosixMethod · 0.45
summingUpRealMethod · 0.45
betweenDatesMethod · 0.45
streamMethod · 0.45
longyearbyenMethod · 0.45
stream1Method · 0.45
stream2Method · 0.45

Calls 4

getBaseUnitMethod · 0.80
getChronologyMethod · 0.45
plusMethod · 0.45
minusMethod · 0.45

Tested by 15

summingUpMethod · 0.36
getRegisteredElementsMethod · 0.36
getRegisteredElementsMethod · 0.36
summingUpPosixMethod · 0.36
summingUpRealMethod · 0.36
betweenDatesMethod · 0.36
streamMethod · 0.36
longyearbyenMethod · 0.36
stream1Method · 0.36
stream2Method · 0.36
stream4Method · 0.36