shiftEndpoints

fun shiftEndpoints(shiftStart: Duration, shiftEnd: Duration = shiftStart): Windows

Independently shift the start and end points of each interval.

The start and end can be shifted by different amounts, stretching or squishing the interval. If the interval is empty after the shift, it is removed.

Unlike gov.nasa.ammos.aerie.procedural.timeline.ops.ParallelOps.shiftEndpoints, this function DOES coalesce the output. If you stretch the intervals such that they start to overlap, those overlapping intervals will be combined into one. This means that applying the reverse operation (i.e. windows.shiftEndpoints(Duration.ZERO, Duration.MINUTE).shiftEndpoints(Duration.ZERO, Duration.MINUTE.negate()) does NOT necessarily result in the same timeline.

To turn off coalescing behavior, convert it into a Universal timeline first with .isolate($ -> true) or .unsafeCast(Universal::new). You can undo this with .highlight($ -> true).