Class xbTreeNode — provide simple tree data structure
extends Class xbObject
class xbTreeNode : xbObject { xbTreeNode(); // methods void init(); void destory(); xbTreeNode appendChild(xbTreeNode newChild); xbTreeNode insertBefore(xbTreeNode newChild, xbTreeNode refChild); xbTreeNode removeChild(xbTreeNode oldChild); xbTreeNode replaceChild(xbTreeNode newChild, xbTreeNode oldChild); xbTreeNode getRoot(); // properties xbTreeNode parentNode; xbTreeNode firstChild; xbTreeNode lastChild; xbArray childNodes; xbTreeNode previousSibling; xbTreeNode nextSibling; }
xbTreeNode is a simple tree data structure based loosely on the DOM Level 2 Node interface. It is intended to provide a non-DOM related tree data structure.
readonly xbTreeNode - parent of current xbTreeNode
readonly xbTreeNode - first child of current xbTreeNode.
readonly xbTreeNode - last child of current xbTreeNode.
readonly xbArray - list of children of current xbTreeNode.
readonly xbTreeNode - previous Sibling of current xbTreeNode.
readonly xbTreeNode - next Sibling of current xbTreeNode.
Constructs an instance of the xbTreeNode class.
Returns. Nothing
Exceptions
None
Append the newChild xbTreeNode to the end of this node's children and return a reference of the new node. If newChild already is part of a tree, it is first removed from the tree.
Returns. xbTreeNode newChild
Exceptions
None
Insert newChild xbTreeNode into this node's children before the refChild and return a reference to the new node. If refChild is null, then newChild is appended. If newChild already is part of a tree, it is first removed from the tree.
Returns. xbTreeNode newChild
Exceptions
xbException: Not found
Remove the oldChild from it's tree and return a reference to it.
Returns. xbTreeNode oldChild
Exceptions
xbException: Not found
Replace oldChild with newChild and return a reference to the old node.
Returns. xbTreeNode oldChild
Exceptions
None
Return the root of the tree that this node belongs to.
Returns. xbTreeNode root of xbTreeNode tree this xbTreeNode belongs to.
Exceptions
None