Burgerlib Python
Loading...
Searching...
No Matches
burger.Node Class Reference

Node class for creating directory trees. More...

Public Member Functions

 __init__ (self, value, children=None)
 Create a node with an initial value.
 __repr__ (self, level=0)
 Display this node as a string.
 __str__ (self, level=0)
 Display this node as a string.

Public Attributes

 value = value
 Value contained in this node.
 children = children
 Array of children nodes to this node.

Detailed Description

Node class for creating directory trees.

Needed for some projects that have to store file entries in nested trees

Constructor & Destructor Documentation

◆ __init__()

burger.Node.__init__ ( self,
value,
children = None )

Create a node with an initial value.

Parameters
valueObject to be the value of this node
childrenArray of nodes to be added as children to this one

Member Function Documentation

◆ __repr__()

burger.Node.__repr__ ( self,
level = 0 )

Display this node as a string.

Parameters
levelRecursion depth (Used internally)

◆ __str__()

burger.Node.__str__ ( self,
level = 0 )

Display this node as a string.

Parameters
levelRecursion depth (Used internally)