Search Results for

    Show / Hide Table of Contents

    Class FullyIterativeStringifier<TEdge, TNode>


    Iterative implementation.

    Inheritance
    System.Object
    StringifierBase<TEdge, TNode>
    FullyIterativeStringifier<TEdge, TNode>
    Implements
    IStringifier<TEdge, TNode>
    Inherited Members
    StringifierBase<TEdge, TNode>.NewLine
    StringifierBase<TEdge, TNode>.Indent
    StringifierBase<TEdge, TNode>.PathSeparator
    StringifierBase<TEdge, TNode>.RootStringifier
    StringifierBase<TEdge, TNode>.EdgeAndNodeStringifier
    StringifierBase<TEdge, TNode>.Stringify(TNode)
    StringifierBase<TEdge, TNode>.Stringify(TreePath<TEdge, TNode>)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: MoreStructures.RecImmTrees.Conversions
    Assembly: MoreStructures.dll
    Syntax
    public class FullyIterativeStringifier<TEdge, TNode> : 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.

    Remarks

    ADVANTAGES AND DISADVANTAGES

    Constructors

    | Improve this Doc View Source

    FullyIterativeStringifier(Func<TNode, String>, Func<TEdge, TNode, String>)

    Declaration
    public FullyIterativeStringifier(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 Source

    PrependLevelAfterStopIndenting

    Whether the actual level should be prepended to the line, once the maximum level of indentation defined at StopIndentingLevel has been reached. Default is true.

    Declaration
    public bool PrependLevelAfterStopIndenting { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    StopIndentingLevel

    The maximum level at which indentation should not be done anymore. Default is System.Int32.MaxValue.

    Declaration
    public int StopIndentingLevel { get; set; }
    Property Value
    Type Description
    System.Int32
    Remarks

    COMPLEXITY
    - When trying to render a very deep structure to string, the resulting string can become extremely big due to indentation.
    - This can easily happen with structures like SuffixTrieNode. Less with SuffixTreeNode, due to their coalescing of paths of nodes with single child.
    - For example if the structure is a linear chain of n in depth, 4 chars of indentation per line would yield a string of 2n(n-1) chars = O(n^2).
    - For n = 10000 nodes the produced string would be ~ 200M.
    - To avoid that StopIndentingLevel can be set to a constant c, limiting the size of the resulting string by an upper bound of cn = O(n).
    - For n = 10000 nodes and c = 10 levels the produced string would be 100K.

    Methods

    | Improve this Doc View Source

    Stringify(TNode)

    Declaration
    public override string Stringify(TNode node)
    Parameters
    Type Name Description
    TNode node
    Returns
    Type Description
    System.String
    Overrides
    MoreStructures.RecImmTrees.Conversions.StringifierBase<TEdge, TNode>.Stringify(TNode)
    | Improve this Doc View Source

    Stringify(TreePath<TEdge, TNode>)

    Declaration
    public override string Stringify(TreePath<TEdge, TNode> path)
    Parameters
    Type Name Description
    TreePath<TEdge, TNode> path
    Returns
    Type Description
    System.String
    Overrides
    MoreStructures.RecImmTrees.Conversions.StringifierBase<TEdge, TNode>.Stringify(MoreStructures.RecImmTrees.TreePath<TEdge, TNode>)

    Implements

    IStringifier<TEdge, TNode>

    Extension Methods

    SuffixStructureNodeExtensions.GetAllSuffixesFor<TEdge, TNode>(TNode, TextWithTerminator)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX