dataUtils::Node Class Reference

Inheritance diagram for dataUtils::Node:

Inheritance graph

List of all members.

Public Member Functions

def __init__
def __cmp__
def __repr__
def toString
def addChild
def removeChild
def removeAllChildren
def getChildren
def setContent
def getContent
def dropContent
def searchChildren
def listDepthFirst
def listByHeight
def searchContent
def searchPathToContent
def display

Public Attributes


Detailed Description

Nodes are trees : they can contain other nodes.
Each node can carry a content, whose type is NodeContent.

Definition at line 28 of file

Member Function Documentation

def dataUtils::Node::__cmp__ (   self,

Definition at line 41 of file

def dataUtils::Node::__init__ (   self,
  newContent = None 

Creates an empty node with no child node.

Reimplemented in dataUtils::NodeExample.

Definition at line 35 of file

def dataUtils::Node::__repr__ (   self  ) 

Returns a textual representation of this node's state.

Definition at line 45 of file

def dataUtils::Node::addChild (   self,

Adds a child to current node.

Definition at line 109 of file

def dataUtils::Node::display (   self  ) 

Definition at line 215 of file

def dataUtils::Node::dropContent (   self  ) 

Removes this node's content.

Definition at line 140 of file

def dataUtils::Node::getChildren (   self  ) 

Returns this node's children.

Definition at line 123 of file

def dataUtils::Node::getContent (   self  ) 

Returns this node's current content.

Definition at line 135 of file

def dataUtils::Node::listByHeight (   self,
  first = True 

Walks the tree height by height, starting from root node, and returns the list of 
encountered nodes.

Definition at line 164 of file

def dataUtils::Node::listDepthFirst (   self  ) 

Walks the tree depth-first, returns the list of encountered nodes.

Definition at line 153 of file

def dataUtils::Node::removeAllChildren (   self  ) 

Definition at line 119 of file

def dataUtils::Node::removeChild (   self,

Removes specified child, raises an exception if child not found.

Definition at line 114 of file

def dataUtils::Node::searchChildren (   self,

Searches through node's children the first, if any, that has specified content.

Definition at line 145 of file

def dataUtils::Node::searchContent (   self,

Searches through internal content and then recursively through children for 
specified content.Returns the first node found having the content, if any.
Otherwise, returns None.
content -> list of nodes

Definition at line 178 of file

def dataUtils::Node::searchPathToContent (   self,

Returns, if possible, the path from the first found node whose 
content matches specified content to root node.

Definition at line 196 of file

def dataUtils::Node::setContent (   self,

Sets a new content to current node, which must not have already a content.

Definition at line 128 of file

def dataUtils::Node::toString (   self,
  offset = 0,
  nextOffset = 0,
  isFirstChild = True 

Returns a stringified description of the tree.
__ a __ b
      |_ c __ d __ e
        |_ f
      |_ g

offset is the current position where to write
nexOffset is the position where children should begin 	

Definition at line 61 of file

Member Data Documentation

Definition at line 38 of file

Reimplemented in dataUtils::NodeExample.

Definition at line 37 of file

The documentation for this class was generated from the following file:

Generated on Thu Jun 4 20:41:14 2009 for Ceylan by  doxygen 1.5.8