Class ConsolePrinter

java.lang.Object
org.strassburger.tui4j.printer.ConsolePrinter
All Implemented Interfaces:
Printer

public class ConsolePrinter extends Object implements Printer
A Printer implementation that outputs to the console (System.out)
  • Constructor Details

    • ConsolePrinter

      public ConsolePrinter()
      Creates a ConsolePrinter with the default AnsiRenderer
    • ConsolePrinter

      public ConsolePrinter(StyledTextRenderer renderer)
      Creates a ConsolePrinter with a custom StyledTextRenderer
      Parameters:
      renderer - the StyledTextRenderer to use for rendering styled text
  • Method Details

    • print

      public void print(String text)
      Description copied from interface: Printer
      Print raw text to the output
      Specified by:
      print in interface Printer
      Parameters:
      text - the text to print
    • print

      public void print(StyledText text)
      Description copied from interface: Printer
      Print styled text to the output
      Specified by:
      print in interface Printer
      Parameters:
      text - the styled text to print
    • print

      public void print(Renderable renderable)
      Description copied from interface: Printer
      Print a renderable object to the output
      Specified by:
      print in interface Printer
      Parameters:
      renderable - the renderable object to print
    • println

      public void println()
      Description copied from interface: Printer
      Print a newline to the output
      Specified by:
      println in interface Printer
    • println

      public void println(String text)
      Description copied from interface: Printer
      Print raw text to the output with a newline
      Specified by:
      println in interface Printer
      Parameters:
      text - the text to print
    • println

      public void println(StyledText text)
      Description copied from interface: Printer
      Print styled text to the output with a newline
      Specified by:
      println in interface Printer
      Parameters:
      text - the styled text to print
    • println

      public void println(Renderable renderable)
      Description copied from interface: Printer
      Print a renderable object to the output with a newline
      Specified by:
      println in interface Printer
      Parameters:
      renderable - the renderable object to print
    • printf

      public void printf(String format, Object... args)
      Description copied from interface: Printer
      Format and print text to the output
      Specified by:
      printf in interface Printer
      Parameters:
      format - the format string
      args - the arguments to format
    • printfln

      public void printfln(String format, Object... args)
      Description copied from interface: Printer
      Format and print text to the output with a newline
      Specified by:
      printfln in interface Printer
      Parameters:
      format - the format string
      args - the arguments to format
    • printf

      public void printf(StyledText format, Object... args)
      Description copied from interface: Printer
      Format and print styled text to the output
      Specified by:
      printf in interface Printer
      Parameters:
      format - the styled text format
      args - the arguments to format
    • printfln

      public void printfln(StyledText format, Object... args)
      Description copied from interface: Printer
      Format and print styled text to the output with a newline
      Specified by:
      printfln in interface Printer
      Parameters:
      format - the styled text format
      args - the arguments to format