Class TreeNode<T>
- Namespace
- Garyon.DataStructures.Trees
- Assembly
- Garyon.dll
Represents a tree node, which is a component that is contained within a tree.
public class TreeNode<T> : TreeNode<T, Tree<T>, TreeNode<T>>, ITreeNode<T, Tree<T>, TreeNode<T>>, ITreeNode<T>, IEnumerable<T>, IEnumerable
Type Parameters
TThe type of the value that is stored in the node.
- Inheritance
-
TreeNode<T>
- Implements
-
ITreeNode<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
TreeNode(TreeNode<T>, List<TreeNode<T>>, T)
Initializes a new instance of the TreeNode<T> class with a parent and children nodes. The base tree is considered to be that of the parent.
public TreeNode(TreeNode<T> parentNode, List<TreeNode<T>> childrenNodes, T value = default)
Parameters
parentNodeTreeNode<T>The parent node.
childrenNodesList<TreeNode<T>>The children nodes.
valueTThe value of the node.
TreeNode(TreeNode<T>, T)
Initializes a new instance of the TreeNode<T> class with a parent node, but no children nodes. The base tree is considered to be that of the parent.
public TreeNode(TreeNode<T> parentNode, T value = default)
Parameters
parentNodeTreeNode<T>The parent node.
valueTThe value of the node.
TreeNode(Tree<T>, T)
Initializes a new instance of the TreeNode<T> class with a base tree, but no parent or children nodes.
public TreeNode(Tree<T> baseTree, T value = default)
Parameters
baseTreeTree<T>The base tree that contains this node.
valueTThe value of the node.
TreeNode(T)
Initializes a new instance of the TreeNode<T> class with no base tree, parent or children nodes.
public TreeNode(T value = default)
Parameters
valueTThe value of the node.
Methods
InitializeNewNode(TreeNode<T>, T)
Initializes a new instance of the TreeNode<T> class with a parent node. The base tree is considered to be that of the parent.
protected override TreeNode<T> InitializeNewNode(TreeNode<T> parentNode, T value = default)
Parameters
parentNodeTreeNode<T>The parent node.
valueTThe value of the node.
Returns
- TreeNode<T>
InitializeNewNode(Tree<T>, T)
Initializes a new instance of the TreeNode<T> class with a base tree, but no parent node.
protected override TreeNode<T> InitializeNewNode(Tree<T> baseTree, T value = default)
Parameters
baseTreeTree<T>The base tree that contains this node.
valueTThe value of the node.
Returns
- TreeNode<T>
InitializeNewNode(T)
Initializes a new instance of the TreeNode<T> class with no base tree or parent node.
protected override TreeNode<T> InitializeNewNode(T value = default)
Parameters
valueTThe value of the node.
Returns
- TreeNode<T>