Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RadixNodeEdges<T>

A simple Map<string, RadixNode>, but also maintains a single invariant:

  • Only a single key can start with a particular character

This invariant means that we can find the key that shares a prefix with a given string in O(1).

Type parameters

  • T

Hierarchy

  • RadixNodeEdges

Index

Constructors

constructor

Properties

firstCharToKeyMap

firstCharToKeyMap: Map<string, string>

m

m: Map<string, RadixNode<T>>

Accessors

size

  • get size(): number
  • get the number of elements (edges to other RadixNodes) in the map

    Returns number

Methods

delete

  • delete(k: string): boolean
  • Delete a key from this RadixNodeEdges. Cannot corrupt the state of the edges list.

    Parameters

    • k: string

    Returns boolean

entries

  • entries(): IterableIterator<[string, RadixNode<T>]>
  • A generator over all [key, node] pairs in the map. Returns pairs of values of the same type as those that were added to the map via set(k, v)

    Returns IterableIterator<[string, RadixNode<T>]>

findKeyHavingSharedPrefix

  • findKeyHavingSharedPrefix(prefix: string): string | undefined
  • Parameters

    • prefix: string

    Returns string | undefined

    either the matching key or undefined if no matching key

get

has

  • has(k: string): boolean
  • Check if a there are is an edge associated to a particular key.

    Parameters

    • k: string

    Returns boolean

keys

  • keys(): IterableIterator<string>
  • A generator over all keys inserted into the map via set(k, v)

    Returns IterableIterator<string>

set

values

Generated using TypeDoc