Class TableGenerator
java.lang.Object
org.variantsync.diffdetective.tablegen.TableGenerator
Converter of analysis results to LaTex tables.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
LaTex code for a horizontal line to separate two rows.static final String
LaTex code for a horizontal line to separate two rows as a pseudo row.protected static final String
The indentation used for the rows of the generated table.private final TableDefinition
Style and column definitions of the table. -
Constructor Summary
ConstructorDescriptionTableGenerator
(TableDefinition tableDef) Constructs aTableGenerator
constructing a table according totableDef
. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addCell
(StringBuilder builder, Object val) Adds a single cell to the rowbuilder
withval
as data.static void
addHeader
(StringBuilder builder, Object val) Adds a single header cell to the rowbuilder
withval
as data.private static void
addHeader
(StringBuilder builder, Object val, String delim) Add a single header cell, annotating it appropriately.static void
addLastCell
(StringBuilder builder, Object val) Adds the last cell of the rowbuilder
withval
as data.static void
addLastHeader
(StringBuilder builder, Object val) Adds the last header cell of the rowbuilder
withval
as data.static List<ContentRow>
Returns a new alphabetically sorted list.generateTable
(List<ContentRow> datasets, ContentRow ultimateResult) Convertdatasets
to a LaTex table according to the template represented by this class.
-
Field Details
-
INDENT
The indentation used for the rows of the generated table.- See Also:
-
HLINE
LaTex code for a horizontal line to separate two rows.- See Also:
-
HLINE_ROW
LaTex code for a horizontal line to separate two rows as a pseudo row.- See Also:
-
tableDef
Style and column definitions of the table.
-
-
Constructor Details
-
TableGenerator
Constructs aTableGenerator
constructing a table according totableDef
.
-
-
Method Details
-
generateTable
Convertdatasets
to a LaTex table according to the template represented by this class. The column headers and the data they contain are configurable by the table definition given in theconstructor
.- Parameters:
datasets
- the dataset to be convertedultimateResult
- a summary row added according to the table definition- Returns:
- the LaTex code for a table representing
datasets
-
addHeader
Add a single header cell, annotating it appropriately. The macroresultTableHeader
has to be defined to format the lines containing header strings longer than 6 characters.- Parameters:
builder
- the header row to which the cell is addedval
- the content of the header celldelim
- the delimiter between this cell and the next cell
-
addHeader
Adds a single header cell to the rowbuilder
withval
as data. This cell can't be the last header in the row. In that case it has to added byaddLastHeader(java.lang.StringBuilder,java.lang.Object)
. -
addLastHeader
Adds the last header cell of the rowbuilder
withval
as data. -
addCell
Adds a single cell to the rowbuilder
withval
as data. This cell can't be the last cell in the row. In that case it has to added byaddLastCell(java.lang.StringBuilder,java.lang.Object)
.- See Also:
-
addLastCell
Adds the last cell of the rowbuilder
withval
as data.- See Also:
-
alphabeticallySorted
Returns a new alphabetically sorted list.
-