Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TreeIterator<T>

An iterator interface for RangeSetTree.

This interface is expected to be an ascending iterator, i.e. iterating from the lowest element in the set to the highest. Therefore, TreeIterator.prev is expected to switch it to the lower element in the tree upon each invocation.

An empty iterator is represented by TreeIterator.data being null. Calling TreeIterator.prev on an empty iterator should re-point it at the highest value in the tree, returning that value.

Type parameters

  • T

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

Hierarchy

  • TreeIterator

Index

Properties

Methods

Properties

data

data: T

The data of the node this iterator is pointing at.

Returns null for an empty iterator, i.e. one pointing before the lowest item of the tree, returned by either RangeSetTree.iterator, or one of the bound finder methods, e.g. RangeSetTree.lowerBound.

Methods

prev

  • prev(): T
  • Move TreeIterator.data to the next lower element in this tree, returning said element.

    It should return null for the lowest element in the tree in the order of iteration, and then the highest element on the next invocation.

    Returns T

Generated using TypeDoc