Interface ITree
Represents a tree in a non-generic manner.
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public interface ITree
Properties
Children
Gets the children of the current tree node.
Declaration
IReadOnlyList<ITree> Children { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<ITree> |
Value
Gets the data stored in the node.
Declaration
object Value { get; }
Property Value
Type | Description |
---|---|
System.Object |
Methods
Accept(ITreeVisitor)
Dispatches the current tree instance to the tree visitor's Visit method.
Declaration
ITree Accept(ITreeVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
ITreeVisitor | visitor | Visitor to accept the tree. |
Returns
Type | Description |
---|---|
ITree | Result of the visit. |
ToString(Int32)
Gets a string representation of the current node and its children, using the specified indentation level.
Declaration
string ToString(int indent)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | indent | Indentation level. Recursive calls to obtain a string representation of child nodes will use an incremented indentation level. |
Returns
Type | Description |
---|---|
System.String | String representation of the current node. |
ToStringFormat()
Gets a format string with placeholders for the children. To be used with String.Format.
Declaration
string ToStringFormat()
Returns
Type | Description |
---|---|
System.String | Format string that can be used to retrieve a string representation of the current node by supplying string representations of child nodes. |
Update(IEnumerable<ITree>)
Updates the tree with the given children, returning a new immutable tree.
Declaration
ITree Update(IEnumerable<ITree> children)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ITree> | children | Child nodes for the copy of the current node. |
Returns
Type | Description |
---|---|
ITree | New immutable tree based on the current node, but with the specified child nodes. |