Class StringifierBase<TEdge, TNode>
Provides concrete properties and defaults for new line, identation and stringifiers.
Inheritance
Implements
Inherited Members
Namespace: MoreStructures.RecImmTrees.Conversions
Assembly: MoreStructures.dll
Syntax
public abstract class StringifierBase<TEdge, TNode> : IStringifier<TEdge, TNode> where TEdge : IRecImmDictIndexedTreeEdge<TEdge, TNode> where TNode : IRecImmDictIndexedTreeNode<TEdge, TNode>
Type Parameters
Name | Description |
---|---|
TEdge | The type of edges of the specific structure. |
TNode | The type of nodes of the specific structure. |
Constructors
| Improve this Doc View SourceStringifierBase(Func<TNode, String>, Func<TEdge, TNode, String>)
Builds an instance of an IStringifier<TEdge, TNode> with the provided stringifiers, for the root and for all other nodes in the three, and with default new line and indent.
Declaration
protected StringifierBase(Func<TNode, string> rootStringifier, Func<TEdge, TNode, string> edgeAndNodeStringifier)
Parameters
Type | Name | Description |
---|---|---|
Func<TNode, System.String> | rootStringifier | |
Func<TEdge, TNode, System.String> | edgeAndNodeStringifier |
Properties
| Improve this Doc View SourceEdgeAndNodeStringifier
A function mapping the provided edge and node to a string. Used for all lines of the output but the first.
Declaration
public Func<TEdge, TNode, string> EdgeAndNodeStringifier { get; set; }
Property Value
Type | Description |
---|---|
Func<TEdge, TNode, System.String> |
Indent
Declaration
public string Indent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
NewLine
Declaration
public string NewLine { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PathSeparator
Declaration
public string PathSeparator { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RootStringifier
A function mapping the top-level node to a string. Used for the first line of the output.
Declaration
public Func<TNode, string> RootStringifier { get; set; }
Property Value
Type | Description |
---|---|
Func<TNode, System.String> |
Methods
| Improve this Doc View SourceStringify(TNode)
Converts the provided IRecImmDictIndexedTreeNode<TEdge, TNode> into a string.
Declaration
public abstract string Stringify(TNode node)
Parameters
Type | Name | Description |
---|---|---|
TNode | node | The root of the tree to stringify. |
Returns
Type | Description |
---|---|
System.String | A string version of the provided structure. |
Stringify(TreePath<TEdge, TNode>)
Converts the provided TreePath<TEdge, TNode> into a string.
Declaration
public abstract string Stringify(TreePath<TEdge, TNode> path)
Parameters
Type | Name | Description |
---|---|---|
TreePath<TEdge, TNode> | path | The tree path to stringify. |
Returns
Type | Description |
---|---|
System.String | A string version of the provided path. |