Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RangeSetTree<T>

A plug-in interface for custom tree implementations.

Type parameters

  • T

    The type this tree holds. It must be opaque for the actual tree implementation.

Hierarchy

  • RangeSetTree

Index

Properties

size

size: number

Methods

clear

  • clear(): void

insert

  • insert(item: T): void

iterator

  • An iterator through the tree, conforming to TreeIterator's requirements.

    This method should return an empty iterator, i.e. one pointing before the lowest item in the tree.

    Examples:

    // Initially an empty iterator:
    const iterator = Tree([1, 2, 3]).iterator();
    iterator.data === null; // -> true
    
    // Now, moving down one element, cycling the tree around:
    iterator.prev() === 3; // -> true
    
    // Now, if we check the data again:
    iterator.data === 3; // -> true
    

    Returns TreeIterator<T>

lowerBound

  • Return the node equal or immediately after item.

    Examples:

    • Tree([1, 3, 5]).lowerBound(3) -> 3
    • Tree([1, 3, 5]).lowerBound(4) -> 5

    Parameters

    • item: T

      The value to search by.

    Returns TreeIterator<T>

    An iterator with data pointing at the desired node, an empty iterator otherwise (see TreeIterator).

remove

  • remove(item: T): void

upperBound

  • Return the node immediately after item.

    Examples:

    • Tree([1, 3, 5]).upperBound(3) -> 5
    • Tree([1, 3, 5]).upperBound(4) -> 5

    Parameters

    • item: T

      The value to search by.

    Returns TreeIterator<T>

    An iterator with data pointing at the desired node, an empty iterator otherwise (see TreeIterator).

Generated using TypeDoc