Package concurrent_tree_crawler :: Module abstract_tree_navigator :: Class AbstractTreeNavigator
[hide private]
[frames] | no frames]

Class AbstractTreeNavigator

source code


An object that has a direct access to the elements of the domain tree (e.g. web pages) traversed by the crawler.

Each method declared in this abstract class can raise a NavigationException. If such an exception is raised, it will be gently handled by the crawler -- it won't terminate the crawler thread nor the whole program, but the information that an error occurred will be saved in the tree data structure and the crawler will be restarted. If other kind of exception is raised, it will terminate the thread and the whole program.

Instance Methods [hide private]
list of strings
get_children(self)
Returns: names of children of the current node of the domain tree
source code
 
move_to_child(self, child_name)
Move to the child of the current node of the domain tree.
source code
 
move_to_parent(self)
Move to the parent of the current node of the domain tree.
source code
 
process_node_and_check_if_is_leaf(self)
Returns: True if the current node is a leaf, False if it is an internal node of the domain tree.
source code
 
start_in_root(self)
Start in the root node of the domain tree
source code
Method Details [hide private]

get_children(self)

source code 
Returns: list of strings
names of children of the current node of the domain tree
Raises:
  • NavigationException - see class description for details of ramification of raising such an exception.

move_to_child(self, child_name)

source code 

Move to the child of the current node of the domain tree.

Parameters:
  • child_name - name of the child to move to
Raises:
  • NavigationException - see class description for details of ramification of raising such an exception.

move_to_parent(self)

source code 

Move to the parent of the current node of the domain tree.

Raises:
  • NavigationException - see class description for details of ramification of raising such an exception.

process_node_and_check_if_is_leaf(self)

source code 
Returns:
True if the current node is a leaf, False if it is an internal node of the domain tree.
Raises:
  • NavigationException - see class description for details of ramification of raising such an exception.

start_in_root(self)

source code 

Start in the root node of the domain tree

Raises:
  • NavigationException - see class description for details of ramification of raising such an exception.