Interface ITree<T>
Represents a tree in a generic manner.
Inherited Members
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public interface ITree<T> : ITree
Type Parameters
Name | Description |
---|---|
T | Type of the data contained in the tree nodes. |
Properties
Children
Gets the children of the current tree node.
Declaration
IReadOnlyList<ITree<T>> Children { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<ITree<T>> |
Value
Gets the data stored in the node.
Declaration
T Value { get; }
Property Value
Type | Description |
---|---|
T |
Methods
Accept(ITreeVisitor<T>)
Dispatches the current tree instance to the tree visitor's Visit method.
Declaration
ITree<T> Accept(ITreeVisitor<T> visitor)
Parameters
Type | Name | Description |
---|---|---|
ITreeVisitor<T> | visitor | Visitor to accept the tree. |
Returns
Type | Description |
---|---|
ITree<T> | Result of the visit. |
Update(IEnumerable<ITree<T>>)
Updates the tree with the given children, returning a new immutable tree.
Declaration
ITree<T> Update(IEnumerable<ITree<T>> children)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ITree<T>> | children | Child nodes for the copy of the current node. |
Returns
Type | Description |
---|---|
ITree<T> | New immutable tree based on the current node, but with the specified child nodes. |