Package concurrent_tree_crawler :: Module standard_node :: Class StandardNode
[hide private]
[frames] | no frames]

Class StandardNode

source code


A simple in-memory implementation of the AbstractNode.

Instance Methods [hide private]
 
__init__(self, parent=None, name='sentinel', state=0) 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
NodeState
get_state(self)
Returns: state of the node
source code
 
set_state(self, new_state) source code
AbstractNode, it is None if the node is the sentinel node
get_parent(self) source code
 
has_child(self, name)
Returns: True if node has child with given name
source code
AbstractNode
get_child(self, name) source code
list of AbstractNodes
get_children(self) source code
AbstractNode
add_child(self, name, state)
Returns: added child node
source code
 
_has_children(self, state)
An auxiliary method used only by the all_children_are_in_one_of_states method
source code

Inherited from abstract_node.AbstractNode: __str__, all_children_are_in_one_of_states, update_and_get_child

Instance Variables [hide private]
  _children
Array indexed by the NodeState enumeration index
Method Details [hide private]

__init__(self, parent=None, name='sentinel', state=0)
(Constructor)

source code 
Parameters:

get_children_cond(self)

source code 
Returns: threading.Condition
condition object related to the children of this node
Overrides: abstract_node.AbstractNode.get_children_cond
(inherited documentation)

get_name(self)

source code 
Returns:
name of the node. It should be unique among children of this node's parent
Overrides: abstract_node.AbstractNode.get_name
(inherited documentation)

get_state(self)

source code 
Returns: NodeState
state of the node
Overrides: abstract_node.AbstractNode.get_state
(inherited documentation)

set_state(self, new_state)

source code 
Parameters:
  • new_state - new state of the node
Overrides: abstract_node.AbstractNode.set_state
(inherited documentation)

get_parent(self)

source code 
Returns: AbstractNode, it is None if the node is the sentinel node
Overrides: abstract_node.AbstractNode.get_parent
(inherited documentation)

has_child(self, name)

source code 
Returns:
True if node has child with given name
Overrides: abstract_node.AbstractNode.has_child
(inherited documentation)

get_child(self, name)

source code 
Returns: AbstractNode
Overrides: abstract_node.AbstractNode.get_child
(inherited documentation)

get_children(self)

source code 
Returns: list of AbstractNodes
Overrides: abstract_node.AbstractNode.get_children
(inherited documentation)

add_child(self, name, state)

source code 
Returns: AbstractNode
added child node
Overrides: abstract_node.AbstractNode.add_child
(inherited documentation)

_has_children(self, state)

source code 

An auxiliary method used only by the all_children_are_in_one_of_states method

Returns:
True iff the node has at least one child in given state
Overrides: abstract_node.AbstractNode._has_children
(inherited documentation)