Synthia
Generic and flexible data structure generator
ca.uqac.lif.synthia.tree.Node< T > Class Template Reference

Detailed Description

Simple implementation of a labeled nodel.

Author
Sylvain Hallé
Parameters
<T>The type of the node's label

Definition at line 31 of file Node.java.

Public Member Functions

 Node (T label)
 Creates a new node with given label. More...
 
Node< T > addChild (Node< T > c)
 Adds a child to this node. More...
 
List< Node< T > > getChildren ()
 Gets the children of this node. More...
 
getLabel ()
 Gets the label associated to this node. More...
 
String toString ()
 

Protected Attributes

m_label
 The node's label. More...
 
List< Node< T > > m_children
 The children of this node. More...
 

Constructor & Destructor Documentation

◆ Node()

Creates a new node with given label.

Parameters
labelThe label

Definition at line 47 of file Node.java.

Member Function Documentation

◆ addChild()

Node<T> ca.uqac.lif.synthia.tree.Node< T >.addChild ( Node< T >  c)

Adds a child to this node.

Parameters
cThe child to add
Returns
This node

Definition at line 59 of file Node.java.

◆ getChildren()

List<Node<T> > ca.uqac.lif.synthia.tree.Node< T >.getChildren ( )

Gets the children of this node.

Returns
The children

Definition at line 69 of file Node.java.

◆ getLabel()

T ca.uqac.lif.synthia.tree.Node< T >.getLabel ( )

Gets the label associated to this node.

Returns
The label

Definition at line 78 of file Node.java.

◆ toString()

String ca.uqac.lif.synthia.tree.Node< T >.toString ( )

Definition at line 84 of file Node.java.

Member Data Documentation

◆ m_children

List<Node<T> > ca.uqac.lif.synthia.tree.Node< T >.m_children
protected

The children of this node.

Definition at line 41 of file Node.java.

◆ m_label

T ca.uqac.lif.synthia.tree.Node< T >.m_label
protected

The node's label.

Definition at line 36 of file Node.java.


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