class JNode extends JObject

Tree Node Class.

Methods

__construct()

Constructor

void
addChild( JNode $child)

Add child to this node

void
setParent( JNode|null $parent)

Set the parent of a this node

JNode[]
getChildren()

Get the children of this node

JNode|null
getParent()

Get the parent of this node

boolean
hasChildren()

Test if this node has children

boolean
hasParent()

Test if this node has a parent

Details

__construct()

Constructor

void addChild( JNode $child)

Add child to this node

If the child already has a parent, the link is unset

Parameters

JNode $child &$child The child to be added

Return Value

void

void setParent( JNode|null $parent)

Set the parent of a this node

If the node already has a parent, the link is unset

Parameters

JNode|null $parent &$parent The JNode for parent to be set or null

Return Value

void

JNode[] getChildren()

Get the children of this node

Return Value

JNode[] The children

JNode|null getParent()

Get the parent of this node

Return Value

JNode|null JNode object with the parent or null for no parent

boolean hasChildren()

Test if this node has children

Return Value

boolean True if there are children

boolean hasParent()

Test if this node has a parent

Return Value

boolean True if there is a parent