Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Class TreeNodeWalker<T>

    Used for traversing tree structures in depth-first order.

    The nodes being traversed must either implement the ITreeNode interface, or you can pass a callback in the constructor that should return all children for the given node.

    Type Parameters

    Implements

    Constructors

    • Create a new instance using the given nodes. All nodes must implement the ITreeNode interface.

      Type Parameters

      Parameters

      Returns TreeNodeWalker<T>

    • Create a new instance using the given nodes. The childrenCallback will be called to get all children for a node.

      Type Parameters

      Parameters

      • rootNodes: readonly T[]
      • childrenCallback: (parent: T) => readonly T[]

      Returns TreeNodeWalker<T>

    Methods

    • If there are more content blocks to visit by calling next()

      Returns boolean

    • Returns the next node in depth-first order. Calling this method if hasNext() return false will throw an error.

      Returns T