Manages buffer ranges. Ranges are assumed to be inclusive, i.e. [start, end]

Hierarchy

  • BufferManager

Constructors

Properties

bufferMetadata: {
    [rangeIndex: number]: string;
}

Type declaration

  • [rangeIndex: number]: string
buffers: Buffers

Accessors

Methods

  • Adds metadata to a buffer range at the specified index.

    Parameters

    • rangeIndex: number
    • metadata: string

    Returns void

  • Adds a buffer range to the buffer. If the new range overlaps with an existing range, the two ranges are merged. Time complexity: O(nlogn)

    Parameters

    • newRange: readonly [number, number]
    • ignoreRangesWithMetadata: boolean = true

    Returns void

  • Removes the interval that's present in buffers and returns the remaining interval;

    Example

    buffers = [[1,100], [200,300]]
    input range: [5, 105]
    output: [101-105]

    Parameters

    • range: readonly [number, number]

    Returns readonly [number, number]

  • Searches the value in the first range that contains it and removes it. If the value is in the middle of the range, the range is split into two.

    Parameters

    • value: number

    Returns void

Generated using TypeDoc