Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RadixNode<T>

Type parameters

  • T

Hierarchy

  • RadixNode

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

b

b: boolean

c

v

v: T | undefined

Methods

addPrefixToChild

  • addPrefixToChild(prefix: string, child: string): void
  • Add intermediary node between this node and existing child. Use prefix as key to intermediary, and update intermediary's key to current child as needed.

    Parameters

    • prefix: string

      the prefix of child to act as key to new intermediary node. length > 0

    • child: string

      the existing child key. length > 0 and child.startsWith(prefix)

    Returns void

subtreeTraverse

  • subtreeTraverse(prefix?: string, config?: { pruner?: Pruner<T>; searchType?: SearchType }): IterableIterator<KeyMatch<T>>
  • Iterate over all nodes of subtree rooted at this node. Prune the subtree using the provided pruner function. Control the search type with the searchType parameter.

    generator

    Parameters

    • Optional prefix: string

      the prefix shared by all nodes returned

    • Default value config: { pruner?: Pruner<T>; searchType?: SearchType } = {}

      the configuration of the behaviour of the function

      • Optional pruner?: Pruner<T>

        prune nodes tree using this function. false to prune, true to keep

      • Optional searchType?: SearchType

        the type of tree traversal to do. Must be in constants.SearchTypes

    Returns IterableIterator<KeyMatch<T>>

Generated using TypeDoc