public final class Table extends Object
Table class represents an table to be formatted into a
single String, which can be further printed into the console.| Modifier and Type | Class and Description |
|---|---|
static class |
Table.Builder |
| Modifier and Type | Method and Description |
|---|---|
static Table |
of(Object[][] data,
Alignment al,
int width)
Quickly build a table
|
static <T> Table |
of(String[] headers,
T[][] data,
ColumnFormatter<T> f)
Quickly build a table from given data
|
static <T> Table |
of(T[][] data,
ColumnFormatter<T> f)
Quickly build a table
|
String |
toString()
Convert the table in full format to a String
|
public static Table of(Object[][] data, Alignment al, int width)
data - A 2D Object array as the content of the tableal - See enum Alignmentwidth - An integer as the width of each column in the tablepublic static <T> Table of(String[] headers, T[][] data, ColumnFormatter<T> f)
headers - A String array as the headers for the entire tabledata - A 2D array of objects of Type Tf - A single formatter of Type T for all the columns in the tablepublic static <T> Table of(T[][] data, ColumnFormatter<T> f)
data - A 2D array of Type T as the content of the tablef - A single formatter of Type T for all the columns in this tableCopyright © 2016. All rights reserved.