Interface Cursor

interface Cursor {
    buckets(): Bucket[];
    clone(): Cursor;
    current(): Entry;
    currentBucket(): Bucket;
    done(): boolean;
    index(): number;
    isAtHead(): boolean;
    isAtTail(): boolean;
    jumpTo(tuple: Tuple, level?: number): Promise<void>;
    level(): number;
    locked(): boolean;
    next(level?: number): Promise<void>;
    nextBucket(level?: number): Promise<void>;
    nextTuple(tuple: Tuple, level?: number): Promise<void>;
    rootLevel(): number;
}

Methods

  • Returns an array of buckets from root to current level.

    Returns Bucket[]

  • Returns the current entry in the bucket. If the bucket is empty this method will throw an error.

    Returns Entry

  • Returns the current bucket. The last bucket in the array returned by the buckets() method.

    Returns Bucket

  • Returns true or false depending on whether the cursor has reached the end of the tree.

    Returns boolean

  • Returns the index of the current entry in the bucket. If index is -1 the bucket is empty and current() will throw an error.

    Returns number

  • Returns true or false depending on whether the cursor is at the head bucket for the level.

    Returns boolean

  • Returns true or false depending on whether the cursor is at the tail bucket for the level.

    Returns boolean

  • Moves the cursor from root to the tuple or parent tuple at level.

    Parameters

    • tuple: Tuple
    • Optionallevel: number

    Returns Promise<void>

  • Returns the current level of the cursor.

    Returns number

  • Returns true or false depending on whether the cursor is currently being incremented.

    Returns boolean

  • Increments the cursor to the next tuple on the current level.

    Parameters

    • Optionallevel: number

    Returns Promise<void>

  • Increments the cursor to the beginning of the next bucket on the current level.

    Parameters

    • Optionallevel: number

    Returns Promise<void>

  • Parameters

    • tuple: Tuple
    • Optionallevel: number

    Returns Promise<void>

  • Returns the root level of the tree.

    Returns number