Package schrodinger :: Package application :: Package combiglide :: Package packages :: Module classification_scheme :: Class _Node
[hide private]
[frames] | no frames]

Class _Node

A node in the classification scheme. Contains methods to create a node and add its parents and children. Meant to be called only by Scheme in this module, in the course of constructing the classification scheme.

Instance Methods [hide private]
 
__init__(self, scheme, name, level)
Add a node with the given name at the given level.
 
addChild(self, child)
Add a child node to the current node.
 
addParent(self, parent)
Add a parent node to the current node.
_Class
_getOrCreateClassByName(self, class_name)
Return the Class object bearing the given class_name that resides in the current node.
Instance Variables [hide private]
set of _Node children
Children of the current _Node (set indirectly by Scheme.__init__())
int level
Level of the current _Node (set by _Node.__init__())
str name
Name of the current _Node (set by _Node.__init__())
set of _Node parents
Parents of the current _Node (set indirectly by Scheme.__init__())
Scheme scheme
Scheme that the current _Node belongs to (set by _Node.__init__())
Method Details [hide private]

__init__(self, scheme, name, level)
(Constructor)

 

Add a node with the given name at the given level.

Parameters:
  • name (str) - Name of the node
  • level (int) - Level at which the node is to be added

addChild(self, child)

 

Add a child node to the current node.

Parameters:
  • child (_Node) - The child node to be added

addParent(self, parent)

 

Add a parent node to the current node.

Parameters:
  • parent (_Node) - The parent node to be added

_getOrCreateClassByName(self, class_name)

 

Return the Class object bearing the given class_name that resides in the current node. If a class with the given name does not exist in the current node, create it and add it. This is entry point for the creation of classes.

Parameters:
  • class_name (str) - The name of the class to be returned
Returns: _Class
The Class retrieved or newly added