RangeSetBuilder

A range set builder is a data structure that helps build up a RangeSet directly, without first allocating an array of Range objects.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun add(from: DocPos, to: DocPos, value: T)

Add a range. Ranges should be added in sorted (by from and value.startSide) order.

Link copied to clipboard
fun finish(): RangeSet<T>

Finish the range set. Returns the new set. The builder can't be used anymore after this has been called.