Generic Node of a tree structure.
Class Node( [content] )
content | Some generic payload for the tree structure. |
Properties | |
content | |
firstChild | |
lastChild | |
next | |
parent | |
prev | |
Methods | |
appendChild | Adds a child after the already present children. |
change | Exchange this node with another one. node The new node. |
insertAfter | Inserts the parameter after this node node The node to be inserted. |
insertBefore | Inserts the parameter before this node node The node to be inserted. |
prependChild | Adds a child in front of the children |
remove | Detach this node from the tree |
traverse | Recursively traverse the node tree |
Adds a child after the already present children.
appendChild( The, child )
The | child to be added. |
Exchange this node with another one. node The new node.
change( node )
Inserts the parameter after this node node The node to be inserted.
insertAfter( node )
Inserts the parameter before this node node The node to be inserted.
insertBefore( node )
Adds a child in front of the children
prependChild( The, child )
The | child to be added. |
Detach this node from the tree
remove()
Return | The next node, if it exists. |
Recursively traverse the node tree
traverse( f )
f | A callable that will be called with each node. |
The f function is called frist on this node, and then the traverse method of each children is called. This makes the structure descend-first-then-call structure.