Supports taking action on every topic in the topic tree. The traverse() method traverses a topic tree and calls visitor._onTopic() for each topic in the tree that satisfies visitor._accept(). Additionally it calls visitor._startChildren() whenever it starts traversing the subtopics of a topic, and visitor._endChildren() when it is done with the subtopics. Finally, it calls visitor._doneTraversal() when traversal has been completed. The visitor must therefore adhere to the ITopicTreeVisitor interface.
The visitor, if given, must adhere to API of |
|
The visitor must adhere to API of ITopicTreeVisitor. |
|
Start traversing tree at topicObj. Note that topicObj is a |
TopicTreeTraverser
¶Supports taking action on every topic in the topic tree. The traverse() method traverses a topic tree and calls visitor._onTopic() for each topic in the tree that satisfies visitor._accept(). Additionally it calls visitor._startChildren() whenever it starts traversing the subtopics of a topic, and visitor._endChildren() when it is done with the subtopics. Finally, it calls visitor._doneTraversal() when traversal has been completed. The visitor must therefore adhere to the ITopicTreeVisitor interface.
__init__
(self, visitor = None)¶The visitor, if given, must adhere to API of ITopicTreeVisitor. The visitor can be changed or set via setVisitor(visitor) before calling traverse().
setVisitor
(self, visitor)¶The visitor must adhere to API of ITopicTreeVisitor.
traverse
(self, topicObj, how=DEPTH, onlyFiltered=True)¶Start traversing tree at topicObj. Note that topicObj is a Topic object, not a topic name. The how defines if tree should be traversed breadth or depth first. If onlyFiltered is False, then all nodes are accepted (_accept(node) not called).
This method can be called multiple times.