Package jminusminus

Class PrettyPrinter

java.lang.Object
jminusminus.PrettyPrinter

class PrettyPrinter extends Object
A utility class that allows pretty (indented) printing to standard output.
  • Constructor Details

    • PrettyPrinter

      public PrettyPrinter()
      Constructs a pretty printer with an indentation width of 2.
    • PrettyPrinter

      public PrettyPrinter(int indentWidth)
      Constructs a pretty printer.
      Parameters:
      indentWidth - number of blank spaces for an indent.
  • Method Details

    • indentRight

      public void indentRight()
      Indents right.
    • indentLeft

      public void indentLeft()
      Indents left.
    • println

      public void println()
      Prints an empty line to standard output.
    • println

      public void println(String s)
      Prints the specified string (followed by a newline) to standard output.
      Parameters:
      s - string to print.
    • print

      public void print(String s)
      Prints the specified string to standard output.
      Parameters:
      s - string to print.
    • printf

      public void printf(String format, Object... args)
      Prints args to standard output according to the specified format.
      Parameters:
      format - format specifier.
      args - values to print.