mapValues

open fun mapValues(f: (Segment<V>) -> V): THIS

(DOC) Locally transforms the values of a profile without changing the intervals or profile type.

Parameters

f

a function which takes a Segment and returns a new value of type V


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

(DOC) Locally transforms the values of a profile without changing the intervals.

The result can be a different profile type.

Parameters

R

the result's payload type

RESULT

the result's timeline type

ctor

the constructor of the result profile

f

a function which takes a Segment and returns a new value of any type