Class TreeIterator<K, V>Abstract

Type Parameters

  • K

  • V

Hierarchy

Properties

iteratorType: IteratorType

Description

Iterator's type.

Example

console.log(container.end().iteratorType === IteratorType.NORMAL);  // true
container: TreeContainer<K, V>

Description

The container pointed to by the iterator.

Methods

Accessors

  • get pointer(): T
  • Description

    Pointers to element.

    Returns

    The value of the pointer's element.

    Example

    const val = container.begin().pointer;
    

    Returns T

  • set pointer(newValue: T): void
  • Description

    Set pointer's value (some containers are unavailable).

    Example

    (<LinkList<number>>container).begin().pointer = 1;
    

    Parameters

    • newValue: T

      The new value you want to set.

    Returns void

  • get index(): number
  • Description

    Get the sequential index of the iterator in the tree container.
    Note: This function only takes effect when the specified tree container enableIndex = true.

    Returns

    The index subscript of the node in the tree.

    Example

    const st = new OrderedSet([1, 2, 3], true);
    console.log(st.begin().next().index); // 1

    Returns number

Generated using TypeDoc