MutableEventIdentifierGapBuffer
An interface representing a mutable gap buffer, containing a sequence of EventIdentifier, 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
Copies from the gap buffer into the provided EventIdentifierArray.
Gets the EventIdentifier at the given offset.
Pushes the given EventIdentifier at the provided offset (defaults to the end of the buffer).
Pushes the given EventIdentifierArray at the provided offset (defaults to the end of the buffer).
Sets the EventIdentifier at the given offset.
Properties
Extensions
Searches this MutableEventIdentifierGapBuffer for the provided element using the binary search algorithm. The array is expected to be sorted, otherwise the result is undefined.
Searches this MutableEventIdentifierGapBuffer for the provided element using the binary search algorithm. The array is expected to be sorted by site identifiers, otherwise the result is undefined.
Copies the given range from the MutableEventIdentifierGapBuffer.
Returns the insertion index for the given EventIdentifier. 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.
Pushes the given EventIdentifier at the current gap cursor.
Pushes an array of EventIdentifier at the current gap cursor.
Copies the contents of this MutableEventIdentifierGapBuffer into a new EventIdentifierArray.
Copies the contents of this MutableEventIdentifierGapBuffer into a new Array of EventIdentifier.