Package concurrent_tree_crawler :: Module abstract_node :: Class AbstractNode
[hide private]
[frames] | no frames]

Class AbstractNode

source code


A node representing a single element of the tree traversed by the crawler

Instance Methods [hide private]
 
__str__(self) source code
 
_has_children(self, state)
An auxiliary method used only by the all_children_are_in_one_of_states method
source code
AbstractNode
add_child(self, child_name, state)
Returns: added child node
source code
 
all_children_are_in_one_of_states(self, states)
Returns: True iff all children are in one of the given states
source code
AbstractNode
get_child(self, name) source code
list of AbstractNodes
get_children(self) source code
threading.Condition
get_children_cond(self)
Returns: condition object related to the children of this node
source code
 
get_name(self)
Returns: name of the node.
source code
AbstractNode, it is None if the node is the sentinel node
get_parent(self) source code
NodeState
get_state(self)
Returns: state of the node
source code
 
has_child(self, name)
Returns: True if node has child with given name
source code
 
set_state(self, new_state) source code
AbstractNode
update_and_get_child(self, possible_children_names) source code
Method Details [hide private]

_has_children(self, state)

source code 

An auxiliary method used only by the all_children_are_in_one_of_states method

Parameters:
Returns:
True iff the node has at least one child in given state

add_child(self, child_name, state)

source code 
Parameters:
Returns: AbstractNode
added child node

all_children_are_in_one_of_states(self, states)

source code 
Parameters:
Returns:
True iff all children are in one of the given states

get_children_cond(self)

source code 
Returns: threading.Condition
condition object related to the children of this node

get_name(self)

source code 
Returns:
name of the node. It should be unique among children of this node's parent

get_state(self)

source code 
Returns: NodeState
state of the node

has_child(self, name)

source code 
Returns:
True if node has child with given name

set_state(self, new_state)

source code 
Parameters:
  • new_state (NodeState) - new state of the node