Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Tree<T>

Type parameters

  • T

Hierarchy

  • Tree

Index

Constructors

constructor

  • new Tree<T>(): Tree<T>
  • Type parameters

    • T

    Returns Tree<T>

Properties

symbolTree

symbolTree: any

Methods

ancestorsIterator

  • ancestorsIterator(objectArg: T): void
  • Parameters

    • objectArg: T

    Returns void

ancestorsToArray

  • ancestorsToArray(objectArg: T, optionsArg: any): T[]
  • Parameters

    • objectArg: T
    • optionsArg: any

    Returns T[]

appendChild

  • appendChild(referenceObjectArg: T, newObjectArg: T): any
  • Parameters

    • referenceObjectArg: T
    • newObjectArg: T

    Returns any

childrenCount

  • childrenCount(parentArg: T): number
  • Parameters

    • parentArg: T

    Returns number

childrenIterator

  • childrenIterator(parentArg: T, optionsArg: any): T
  • Parameters

    • parentArg: T
    • optionsArg: any

    Returns T

childrenToArray

  • childrenToArray(parentArg: T, optionsArg: any): T[]
  • Parameters

    • parentArg: T
    • optionsArg: any

    Returns T[]

compareTreePosition

  • compareTreePosition(leftArg: T, rightArg: T): number
  • Parameters

    • leftArg: T
    • rightArg: T

    Returns number

firstChild

  • firstChild(objectArg: T): T
  • Parameters

    • objectArg: T

    Returns T

following

  • following(object: T, optionsArg: any): any
  • Parameters

    • object: T
    • optionsArg: any

    Returns any

fromJsonWithHierachy

  • fromJsonWithHierachy(rootElement: T): void
  • builds a tree from a JSON with hierachy

    Parameters

    • rootElement: T

    Returns void

hasChildren

  • hasChildren(objectArg: T): boolean
  • Parameters

    • objectArg: T

    Returns boolean

index

  • index(childArg: T): number
  • Parameters

    • childArg: T

    Returns number

initialize

  • initialize(objectArg: T): T
  • Parameters

    • objectArg: T

    Returns T

insertAfter

  • insertAfter(referenceObject: T, newObjectArg: T): any
  • Parameters

    • referenceObject: T
    • newObjectArg: T

    Returns any

insertBefore

  • insertBefore(referenceObjectArg: T, newObjectArg: T): T
  • Parameters

    • referenceObjectArg: T
    • newObjectArg: T

    Returns T

lastChild

  • lastChild(objectArg: T): T
  • Parameters

    • objectArg: T

    Returns T

lastInclusiveDescendant

  • lastInclusiveDescendant(objectArg: T): T
  • Parameters

    • objectArg: T

    Returns T

nextSibling

  • nextSibling(objectArg: T): T
  • Parameters

    • objectArg: T

    Returns T

nextSiblingsIterator

  • nextSiblingsIterator(objectArg: T): any
  • Parameters

    • objectArg: T

    Returns any

parent

  • parent(objectArg: T): T
  • Parameters

    • objectArg: T

    Returns T

preceding

  • preceding(objectArg: T, optionsArg?: any): T
  • Parameters

    • objectArg: T
    • Optional optionsArg: any

    Returns T

prependChild

  • prependChild(referenceObjectArg: T, newObjectArg: T): T
  • Parameters

    • referenceObjectArg: T
    • newObjectArg: T

    Returns T

previousSibling

  • previousSibling(objectArg: T): T
  • Parameters

    • objectArg: T

    Returns T

previousSiblingsIterator

  • previousSiblingsIterator(objectArg: T): T
  • Parameters

    • objectArg: T

    Returns T

remove

  • remove(removeObjectArg: T): T
  • Parameters

    • removeObjectArg: T

    Returns T

toJsonWithHierachy

  • toJsonWithHierachy(rootElement: T): void
  • returns a branch of the tree as JSON can be user

    Parameters

    • rootElement: T

    Returns void

treeIterator

  • treeIterator(rootArg: T, optionsArg: any): Iterable<T>
  • Parameters

    • rootArg: T
    • optionsArg: any

    Returns Iterable<T>

treeToArray

  • treeToArray(rootArg: T, optionsArg: any): T[]
  • Parameters

    • rootArg: T
    • optionsArg: any

    Returns T[]

Generated using TypeDoc