Class LineWriter

java.lang.Object
dev.toonformat.jtoon.encoder.LineWriter

public final class LineWriter extends Object
Line writer that accumulates indented lines for building the final output.
  • Constructor Details

    • LineWriter

      public LineWriter(int indentSize)
      Creates a LineWriter with the specified indentation size.
      Parameters:
      indentSize - Number of spaces per indentation level
  • Method Details

    • push

      public void push(int depth, String content)
      Adds a line with the specified depth and content.
      Parameters:
      depth - Indentation depth (0 = no indentation)
      content - Line content to add
    • toString

      public String toString()
      Joins all accumulated lines with newlines.
      Overrides:
      toString in class Object
      Returns:
      The complete output string