TreeIterator |
A tree iterator.
| TreeIterator | A tree iterator. |
| Functions | |
| preorder | Performs a preorder traversal on a tree. |
| postorder | Performs a postorder traversal on a tree. |
| Variables | |
| node | The tree node being referenced. |
| Functions | |
| TreeIterator | Initializes a tree iterator pointing to a given tree node. |
| hasNext | @inheritDoc |
| next | @inheritDoc |
| start | Resets the vertical iterator so that it points to the root of the tree. |
| Properties | |
| data | @inheritDoc |
| data | @inheritDoc |
| childNode | The current child node being referenced. |
| childData | Returns the item the child iterator is pointing to. |
| Functions | |
| valid | Checks if the node is valid. |
| root | Moves the iterator to the root of the tree. |
| up | Moves the iterator up by one level of the tree, so that it points to the parent of the current tree node. |
| down | Moves the iterator down by one level of the tree, so that it points to the first child of the current tree node. |
| nextChild | Moves the child iterator forward by one position. |
| prevChild | Moves the child iterator back by one position. |
| childStart | Moves the child iterator to the first child. |
| childEnd | Moves the child iterator to the last child. |
| childValid | Determines if the child iterator is valid. |
| appendChild | Appends a child node to the child list. |
| prependChild | Prepends a child node to the child list. |
| insertBeforeChild | Inserts a child node before the current child node. |
| insertAfterChild | Inserts a child node after the current child node. |
| removeChild | Unlinks the current child node from the tree. |
| toString | Prints out a string representing the current object. |
Performs a preorder traversal on a tree.
public static function preorder( node: TreeNode, process: Function ):void
Performs a postorder traversal on a tree.
public static function postorder( node: TreeNode, process: Function ):void
The tree node being referenced.
public var node: TreeNode
Initializes a tree iterator pointing to a given tree node.
public function TreeIterator( node: TreeNode = null )
@inheritDoc
public function hasNext():Boolean
@inheritDoc
public function next():*
Resets the vertical iterator so that it points to the root of the tree.
public function start():void
@inheritDoc
public function get data():*
The current child node being referenced.
public function get childNode():TreeNode
Returns the item the child iterator is pointing to.
public function get childData():*
Checks if the node is valid.
public function valid():Boolean
Moves the iterator to the root of the tree.
public function root():void
Moves the iterator up by one level of the tree, so that it points to the parent of the current tree node.
public function up():void
Moves the iterator down by one level of the tree, so that it points to the first child of the current tree node.
public function down():void
Moves the child iterator forward by one position.
public function nextChild():void
Moves the child iterator back by one position.
public function prevChild():void
Moves the child iterator to the first child.
public function childStart():void
Moves the child iterator to the last child.
public function childEnd():void
Determines if the child iterator is valid.
public function childValid():Boolean
Appends a child node to the child list.
public function appendChild( obj: * ):void
Prepends a child node to the child list.
public function prependChild( obj: * ):void
Inserts a child node before the current child node.
public function insertBeforeChild( obj: * ):void
Inserts a child node after the current child node.
public function insertAfterChild( obj: * ):void
Unlinks the current child node from the tree.
public function removeChild():void
Prints out a string representing the current object.
public function toString():String