flatMapValues

open fun flatMapValues(f: (Segment<V>) -> SegmentOps<V, *>): THIS

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


open fun <R : Any, RESULT : SegmentOps<R, RESULT>> flatMapValues(ctor: (Timeline<Segment<R>, RESULT>) -> RESULT, f: (Segment<V>) -> SegmentOps<R, *>): RESULT

(DOC) Maps segments into a collection of nested timelines and flattens them into their original intervals.

Similar to GeneralOps.unsafeFlatMap except that the mapper function cannot change the interval the nested timeline is flattened into.

Parameters

R

the result payload type

RESULT

the result timeline type

ctor

the constructor of the result timeline

f

a mapper function that converts each timeline object to a nested timeline