Package com.opengamma.strata.collect.io
Class AsciiTable
- java.lang.Object
-
- com.opengamma.strata.collect.io.AsciiTable
-
public final class AsciiTable extends Object
An ASCII table generator.Provides the ability to generate a simple ASCII table, typically used on the command line. All data is provided as strings, with formatting the responsibility of the caller.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
generate(List<String> headers, List<AsciiTableAlignment> alignments, List<? extends List<String>> cells)
Generates the ASCII table.
-
-
-
Method Detail
-
generate
public static String generate(List<String> headers, List<AsciiTableAlignment> alignments, List<? extends List<String>> cells)
Generates the ASCII table.The caller specifies the headers for each column and the alignment to use, plus the list of lists representing the data. All data is provided as strings, with formatting the responsibility of the caller.
- Parameters:
headers
- the table headersalignments
- the table alignments, must match the size of the headerscells
- the table cells, outer list of rows, inner list of columns- Returns:
- the table
- Throws:
IllegalArgumentException
- if the number of columns specified is inconsistent
-
-