edit

fun edit(start: Long, pastEnd: Long, edit: (Value?) -> Value?)

Run the edit action for each Value or null within the given range, to produce an alternative Value.

Long.MAX_VALUE must not occur within the span, which is ensured by the constraint start<= pastEnd. The stronger condition, start<pastEnd also prevents empty ranges.

Parameters

start

The start of the range to insert.

pastEnd

The index just past the end of the range to insert.

edit

The function to evaluate to map from the old value of some range to a new value for that range. The input and/or output may be null, indicating an absent range.


fun edit(start: Int, pastEnd: Int, edit: (Value?) -> Value?)

Run the edit action for each Value or null within the given range, to produce an alternative Value. This form takes Int arguments as a convenience.

Parameters

start

The start of the range to insert.

pastEnd

The index just past the end of the range to insert.

edit

The function to evaluate to map from the old value of some range to a new value for that range. The input and/or output may be null, indicating an absent range.