Class PrettyMatrixPrinter

java.lang.Object
battleship.view.matrixprinter.PrettyMatrixPrinter

public final class PrettyMatrixPrinter extends Object
  • Constructor Details

    • PrettyMatrixPrinter

      public PrettyMatrixPrinter()
  • Method Details

    • print

      public static String print(Object[][] table)
      Prints the table with DEFAULT_PRINTER.
      Parameters:
      table - table to print
      Returns:
      String
    • print

      public static <T> String print(T[][] table, Printer<T> printer) throws IllegalArgumentException
      Prints the table with specified printer.
      Type Parameters:
      T - type of data in table
      Parameters:
      table - table to print
      printer - printer
      Returns:
      String
      Throws:
      IllegalArgumentException - if no tabular data provided or no instance of Printer provided