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

Class defining a list-branch object. More...

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

Public Member Functions

def __init__ (self, parent, key)
 Method to initialize a CMLListBranch 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 Member Functions inherited from carputils.cml.cmltree.CMLNode
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...
 

Static Public Member Functions

def from_node (node)
 Method to create a CMLListBranch object. More...
 

Public Attributes

 children
 list to hold the children More...
 
- Public Attributes inherited from carputils.cml.cmltree.CMLNode
 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...
 

Additional Inherited Members

- Properties inherited from carputils.cml.cmltree.CMLNode
 has_key = property
 Check if the CML-Node has a valid key. More...
 

Detailed Description

Class defining a list-branch object.

CMLListBranch are nodes which can hold several CMLNodes as children.

Constructor & Destructor Documentation

◆ __init__()

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

Method to initialize a CMLListBranch object.

Parameters
parentParent node
keyKey string or None

Member Function Documentation

◆ add_child()

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

Add child node.

Parameters
nodechild node
Exceptions
AttributeErrorif node is not an instance of CMLNode
AttributeError

◆ from_node()

def carputils.cml.cmltree.CMLListBranch.from_node (   node)
static

Method to create a CMLListBranch object.

A CMLListBranch object is created from a CMLNode object.

Parameters
nodePlaceholder node
Exceptions
AttributeErrorif node is not an instance of CMLNode
Returns
The CMLListBranch object created

◆ objectify()

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

Objectify node and all child nodes.

Returns
If the key of the node is None, a list of all objectified child nodes is returned, else a list containing the key and the list of all objectified child nodes is returned

◆ serialize()

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

Serialize node and all child nodes.

Returns
If the key of the node is None, a list of all serialized child nodes is returned, else a list containing the key and the list of all serialized child nodes is returned

Member Data Documentation

◆ children

carputils.cml.cmltree.CMLListBranch.children

list to hold the children


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