Class StringTree

java.lang.Object
de.xam.featdoc.markdown.StringTree
All Implemented Interfaces:
Comparable<StringTree>

public class StringTree extends Object implements Comparable<StringTree>
  • Constructor Details

    • StringTree

      public StringTree(@NonNull String label)
  • Method Details

    • toTree

      public static StringTree toTree(com.google.common.collect.ListMultimap<String,String> pairs)
      Takes O(2n) space with n=number of pairs; Runs in O(n)
      Parameters:
      pairs -
      Returns:
      a tree of depth n using all (source,target) pairs to construct the tree
    • addChild

      public StringTree addChild(@NonNull String label)
      Parameters:
      label -
      Returns:
      the child
    • addChildTree

      public StringTree addChildTree(StringTree child)
      Parameters:
      child -
      Returns:
      the child
    • compareTo

      public int compareTo(StringTree o)
      Specified by:
      compareTo in interface Comparable<StringTree>
    • dump

      public void dump()
    • getChildNodesIterator

      public Iterator<StringTree> getChildNodesIterator()
    • getChildNodesIterator

      public Iterator<StringTree> getChildNodesIterator(StringTree node)
    • getLabel

      public String getLabel()
    • getOrCreateChild

      public StringTree getOrCreateChild(@NonNull String s)
    • hasChildren

      public boolean hasChildren()
    • sort

      public void sort()
    • toMarkdownList

      public void toMarkdownList(LineWriter lineWriter)
    • toMarkdownList

      public static void toMarkdownList(List<StringTree> trees, LineWriter lineWriter)
    • toString

      public String toString()
      Overrides:
      toString in class Object