19.1Class Node

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
appendChildAdds a child after the already present children.
changeExchange this node with another one. node The new node.
insertAfterInserts the parameter after this node node The node to be inserted.
insertBeforeInserts the parameter before this node node The node to be inserted.
prependChildAdds a child in front of the children
removeDetach this node from the tree
traverseRecursively traverse the node tree

Properties

content

firstChild

lastChild

next

parent

prev

Methods

appendChild

Adds a child after the already present children.

appendChild( The, child )
The child to be added.

change

Exchange this node with another one. node The new node.

change( node )

insertAfter

Inserts the parameter after this node node The node to be inserted.

insertAfter( node )

insertBefore

Inserts the parameter before this node node The node to be inserted.

insertBefore( node )

prependChild

Adds a child in front of the children

prependChild( The, child )
The child to be added.

remove

Detach this node from the tree

remove()
ReturnThe next node, if it exists.

traverse

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.

Made with http://www.falconpl.org