carputils
Doxygen code documentation for the python framework controlling openCARP
Public Member Functions | Public Attributes | Properties | List of all members
carputils.cml.cmltree.CMLNode Class Reference

Class defining a simple node object. More...

Inheritance diagram for carputils.cml.cmltree.CMLNode:
carputils.cml.cmltree.CMLDictBranch carputils.cml.cmltree.CMLLeaf carputils.cml.cmltree.CMLListBranch

Public Member Functions

def __init__ (self, parent, key)
 Method to initialize a CMLNode object. More...
 
def add_child (self, node)
 Add child node. More...
 
def serialize (self)
 Serialize node and all child nodes. More...
 
def objectify (self)
 Objectify node and all child nodes. More...
 

Public Attributes

 parent
 parent node More...
 
 level
 level of the node More...
 
 index
 index of the node in the parent's child collection More...
 
 key
 key of the node (string or None) More...
 

Properties

 has_key = property
 Check if the CML-Node has a valid key. More...
 

Detailed Description

Class defining a simple node object.

CMLNodes are just placeholders and should never occur in the final tree.

Constructor & Destructor Documentation

◆ __init__()

def carputils.cml.cmltree.CMLNode.__init__ (   self,
  parent,
  key 
)

Method to initialize a CMLNode object.

Parameters
parentParent node
keyKey string or None

Member Function Documentation

◆ add_child()

def carputils.cml.cmltree.CMLNode.add_child (   self,
  node 
)

Add child node.

Note
This is just a method interface, a NotImplementedError will be raised when the method is called.
Parameters
nodechild node
Exceptions
NotImplementedError

◆ objectify()

def carputils.cml.cmltree.CMLNode.objectify (   self)

Objectify node and all child nodes.

Note
This is just a method interface, a NotImplementedError will be raised when the method is called.

◆ serialize()

def carputils.cml.cmltree.CMLNode.serialize (   self)

Serialize node and all child nodes.

Note
This is just a method interface, a NotImplementedError will be raised when the method is called.

Member Data Documentation

◆ index

carputils.cml.cmltree.CMLNode.index

index of the node in the parent's child collection

◆ key

carputils.cml.cmltree.CMLNode.key

key of the node (string or None)

◆ level

carputils.cml.cmltree.CMLNode.level

level of the node

◆ parent

carputils.cml.cmltree.CMLNode.parent

parent node

Property Documentation

◆ has_key

carputils.cml.cmltree.CMLNode.has_key = property
static

Check if the CML-Node has a valid key.

Returns
True is key is valid, False otherwise

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