MutableIntGapBuffer
An interface representing a mutable gap buffer, containing a sequence of Int, which is optimized for chunk insertions and removals.
Gap buffers are data structures which support amortized constant-time consecutive insertions, similarly to an array-based list, but at arbitrary buffer positions. They may be used to store a sequence of items which are known to be inserted group-wise.
In a gap buffer, positions are known as offsets. An offset is semantically identical to an index in an array, except that it jumps over the gap.
Functions
Properties
Extensions
Searches this MutableIntGapBuffer for the provided element using the binary search algorithm. The array is expected to be sorted, otherwise the result is undefined.
Copies the given range from the MutableIntGapBuffer.
Returns the insertion index for the given Int. The insertion index can be seen as the index at which the cursor should be moved when inserting an event with the given sequence number and site identifier that would preserve the sorted behavior of the buffer.
Copies the contents of this MutableIntGapBuffer into a new IntArray.
Copies the contents of this MutableIntGapBuffer into a new Array of Int.