PrettyDisplayUtils { public static <T> String displayTable(T[][] table, int nRows, int nCols, String[] rowNames, String[] colNames, String cornerName, int nRowEdgeItems, int nColEdgeItems) { return displayTable( table, nRows, nCols, rowNames, colNames, cornerName, nRowEdgeItems, nColEdgeItems, false ); }  static String display(T v); static String display(T v, boolean useRawDoubleFormat); static String displayDouble(double v, String format); static String displayDouble(double v, String format, boolean useRawDoubleFormat); static String displayDouble(double v); static String displayDouble(double v, boolean useRawDoubleFormat); static String displayList(List<T> list, int numEdgeItems, boolean linebreak); static String displayList(List<T> list, boolean linebreak); static String displayList(List<T> list); static String displayDenseVector(DenseVector dv); static String displayDenseMatrix(DenseMatrix dm); static String displayMap(Map<?, ?> m, int numEdgeItems, boolean linebreak); static String displayMap(Map<?, ?> m); static String displayTable(T[][] table, int nRows, int nCols,
                                          String[] rowNames, String[] colNames, String cornerName,
                                          int nRowEdgeItems, int nColEdgeItems); static String displayTable(T[][] table, int nRows, int nCols,
                                          String[] rowNames, String[] colNames, String cornerName,
                                          int nRowEdgeItems, int nColEdgeItems,
                                          boolean useRawDoubleFormat); static String displayTable(T[][] table, int nRows, int nCols,
                                          String[] rowNames, String[] colNames, String cornerName); static String indentLines(String text, int indentSize); static String prependStringWithIndent(String text, String s); static String displayHeadline(String head, Character padChar);  }
@Test public void testTable() { int nRows = 20; int nCols = 15; Double[][] table = new Double[nRows][nCols]; for (int i = 0; i < nRows; i += 1) { for (int j = 0; j < nCols; j += 1) { table[i][j] = RandomUtils.nextDouble(0.0, 9999999999999999.0); } } String[] rowNames = new String[nRows]; for (int i = 0; i < nRows; i += 1) { rowNames[i] = "row" + i; } String[] colNames = new String[nCols]; for (int i = 0; i < nCols; i += 1) { colNames[i] = "col" + i; } String ret = PrettyDisplayUtils.displayTable(table, nRows, nCols, rowNames, colNames, null, 3, 3); System.out.println(ret); System.out.println(PrettyDisplayUtils.displayTable(table, nRows, nCols, rowNames, colNames, "features", 2, 1)); System.out.println(PrettyDisplayUtils.displayTable(table, nRows, nCols, null, colNames, "features", 2, 1)); System.out.println(PrettyDisplayUtils.displayTable(table, nRows, nCols, rowNames, null, "features", 2, 1)); System.out.println(PrettyDisplayUtils.displayTable(table, nRows, nCols, null, null, "features", 2, 1)); }