unsafeMap

open fun unsafeMap(boundsTransformer: BoundsTransformer, truncate: Boolean, f: (V) -> V): THIS

(DOC) UNSAFE! A simpler version of unsafeMap for operations that don't change the timeline type.


open fun <R : IntervalLike<R>, RESULT : GeneralOps<R, RESULT>> unsafeMap(ctor: (Timeline<R, RESULT>) -> RESULT, boundsTransformer: BoundsTransformer, truncate: Boolean, f: (V) -> R): RESULT

(DOC) UNSAFE! Maps each timeline object to another object, of potentially a different type, at potentially a different time.

This operation may require the bounds of evaluation to be changed for the timeline it is called on. This can happen if the intervals of any segment are being shifted. This is what the boundsTransformer argument is for. This will ensure that the timeline map is called on will evaluate on the proper bounds.

In rare cases, operations might intentionally shift or create intervals outside the requested bounds, requiring them to be truncated. Pass true for truncate if so (this will add an extra step to truncate the result).

Parameters

R

the result payload type

RESULT

the result timeline type

ctor

the constructor of the result timeline

boundsTransformer

how to transform the bounds for the timeline map is called on

truncate

whether to truncate the result before returning

f

a mapper function that converts each timeline object to another object

See also

for an explanation of why this method is unsafe.