This class walks through an AE tree in a pre-order traversal fashion. More...
Public Member Functions
|AETreeWalker (AENode *in_root)|
|AENode *||GetNext ()|
|Return the next node in a pre-order traversal fashion. |
|simba_size_t||GetNextLevel () const|
|Return the level of the next node in the tree. |
|bool||HasMore () const|
|Indicates whether there are more nodes. |
|AENode *||PeekNext ()|
|Peek at the next node in a pre-order traversal fashion. |
|Skip the current sub tree. |
This class walks through an AE tree in a pre-order traversal fashion.
That is, the first node that it returns is the root node. The second node it returns is the first child of the root node.
The class has been designed so that it only traverses the sub tree that has in_root as the root node. It will never traverse the parent nodes of in_root if it has a parent node.
|in_root||The root node of an AE tree. (NOT OWN)|
|SEInvalidArgumentException||when in_root is NULL|
Return the next node in a pre-order traversal fashion.
Make sure there are more nodes to walk through.
|SEInvalidOpertionException||when HasMore() returns false.|
Return the level of the next node in the tree.
The root of the tree is level 0. The child nodes of the root are all level 1. The child nodes of the child nodes of the root are all level 2, etc.
If one wants to get the tree level for the next node, one MUST call this method before calling GetNext(). The reason is that after calling GetNext(), the tree level returned from this method is for the next node.
Indicates whether there are more nodes.
Peek at the next node in a pre-order traversal fashion.