Class TableGenerator
java.lang.Object
org.variantsync.diffdetective.tablegen.TableGenerator
Converter of analysis results to LaTex tables.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringLaTex code for a horizontal line to separate two rows.static final StringLaTex code for a horizontal line to separate two rows as a pseudo row.protected static final StringThe indentation used for the rows of the generated table.private final TableDefinitionStyle and column definitions of the table. -
Constructor Summary
ConstructorsConstructorDescriptionTableGenerator(TableDefinition tableDef) Constructs aTableGeneratorconstructing a table according totableDef. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCell(StringBuilder builder, Object val) Adds a single cell to the rowbuilderwithvalas data.static voidaddHeader(StringBuilder builder, Object val) Adds a single header cell to the rowbuilderwithvalas data.private static voidaddHeader(StringBuilder builder, Object val, String delim) Add a single header cell, annotating it appropriately.static voidaddLastCell(StringBuilder builder, Object val) Adds the last cell of the rowbuilderwithvalas data.static voidaddLastHeader(StringBuilder builder, Object val) Adds the last header cell of the rowbuilderwithvalas data.static List<ContentRow> Returns a new alphabetically sorted list.generateTable(List<ContentRow> datasets, ContentRow ultimateResult) Convertdatasetsto 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 aTableGeneratorconstructing a table according totableDef.
-
-
Method Details
-
generateTable
Convertdatasetsto 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 macroresultTableHeaderhas 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 rowbuilderwithvalas 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 rowbuilderwithvalas data. -
addCell
Adds a single cell to the rowbuilderwithvalas 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 rowbuilderwithvalas data.- See Also:
-
alphabeticallySorted
Returns a new alphabetically sorted list.
-