Guides

TreeNode
in package

FinalYes
Tags
template-covariant

of Node

Table of Contents

Properties

$children  : array<string|int, Node>>
$node  : TNode
$parent  : Node>|DocumentNode>|null
$root  : TreeNode<string|int, DocumentNode>

Methods

addChild()  : void
createFromDocument()  : TreeNode<string|int, DocumentNode>
findPosition()  : int|null
getChildren()  : array<string|int, TreeNode<string|int, Node>>
getNode()  : TNode
getParent()  : Node>|DocumentNode>|null
getRoot()  : DocumentNode>
isLastChildOfParent()  : bool
pushChild()  : void
removeChild()  : void
replaceChild()  : void
__construct()  : mixed
createFromCompoundNode()  : array<string|int, TreeNode<string|int, Node>>
createFromNode()  : TreeNode<string|int, TValue>
setChildren()  : void
setRoot()  : void

Properties

$children

private array<string|int, Node>> $children = []

$parent

private Node>|DocumentNode>|null $parent = null

Methods

findPosition()

public findPosition(Node $node) : int|null
Parameters
$node : Node
Return values
int|null

getNode()

public getNode() : TNode
Return values
TNode

getParent()

public getParent() : Node>|DocumentNode>|null
Return values
Node>|DocumentNode>|null

getRoot()

public getRoot() : DocumentNode>
Return values
DocumentNode>

isLastChildOfParent()

public isLastChildOfParent() : bool
Return values
bool

replaceChild()

public replaceChild(Node $oldChildNode, Node $newChildNode) : void
Parameters
$oldChildNode : Node
$newChildNode : Node

__construct()

private __construct(Node $node[, self|null $parent = null ]) : mixed
Parameters
$node : Node
$parent : self|null = null

createFromCompoundNode()

private static createFromCompoundNode(CompoundNode<string|int, Node$node, Node>|DocumentNode>|null $parent) : array<string|int, TreeNode<string|int, Node>>
Parameters
$node : CompoundNode<string|int, Node>
$parent : Node>|DocumentNode>|null
Return values
array<string|int, TreeNode<string|int, Node>>

createFromNode()

private static createFromNode(TValue $node[, Node>|DocumentNode>|null $parent = null ]) : TreeNode<string|int, TValue>
Parameters
$node : TValue
$parent : Node>|DocumentNode>|null = null
Return values
TreeNode<string|int, TValue>

setChildren()

private setChildren(array<string|int, Node>$children) : void
Parameters
$children : array<string|int, Node>>

setRoot()

private setRoot(DocumentNode> $root) : void
Parameters
$root : DocumentNode>

        
On this page

Search results