TreeNode
in package
FinalYes
Tags
Table of Contents
Properties
-
$children
: self
[] - $node : TNode
-
$parent
: self
|self |null - $root : TreeNode<string|int, DocumentNode>
Methods
- addChild() : void
- createFromDocument() : TreeNode<string|int, DocumentNode>
- findPosition() : int|null
- getChildren() : TreeNode<string|int, Node>[]
- getNode() : TNode
-
getParent()
: self
|self |null -
getRoot()
: self
- isLastChildOfParent() : bool
- pushChild() : void
- release() : void
- Shadow trees are reference cycles (child to parent and to root), so without this they're only freed by the cycle collector, which also has to walk the whole AST.
- removeChild() : void
- replaceChild() : void
- __construct() : mixed
- createFromCompoundNode() : TreeNode<string|int, Node>[]
- createFromNode() : TreeNode<string|int, TValue>
- setChildren() : void
Properties
$children
private
self []
$children
= []
$node
private
TNode
$node
$parent
private
self |self |null
$parent
= null
$root
private
TreeNode<string|int, DocumentNode>
$root
Methods
addChild()
public
addChild(Node $child) : void
Parameters
- $child : Node
createFromDocument()
public
static createFromDocument(DocumentNode $document) : TreeNode<string|int, DocumentNode>
Parameters
- $document : DocumentNode
Return values
TreeNode<string|int, DocumentNode>findPosition()
public
findPosition(Node $node) : int|null
Parameters
- $node : Node
Return values
int|nullgetChildren()
public
getChildren() : TreeNode<string|int, Node>[]
Return values
TreeNode<string|int, Node>[]getNode()
public
getNode() : TNode
Return values
TNodegetParent()
public
getParent() : self |self |null
Return values
selfgetRoot()
public
getRoot() : self
Return values
selfisLastChildOfParent()
public
isLastChildOfParent() : bool
Return values
boolpushChild()
public
pushChild(Node $child) : void
Parameters
- $child : Node
release()
Shadow trees are reference cycles (child to parent and to root), so without this they're only freed by the cycle collector, which also has to walk the whole AST.
public
release() : void
removeChild()
public
removeChild(Node $node) : void
Parameters
- $node : Node
replaceChild()
public
replaceChild(Node $oldChildNode, Node $newChildNode) : void
Parameters
__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, self |self $parent) : TreeNode<string|int, Node>[]
Parameters
- $node : CompoundNode<string|int, Node>
-
$parent
: self
|self
Return values
TreeNode<string|int, Node>[]createFromNode()
private
static createFromNode(TValue $node, self |self $parent) : TreeNode<string|int, TValue>
Parameters
- $node : TValue
-
$parent
: self
|self
Return values
TreeNode<string|int, TValue>setChildren()
private
setChildren(self [] $children) : void
Parameters
-
$children
: self
[]