Class TableGenerator

java.lang.Object
org.variantsync.diffdetective.tablegen.TableGenerator

public class TableGenerator extends Object
Converter of analysis results to LaTex tables.
  • Field Details

    • INDENT

      protected static final String INDENT
      The indentation used for the rows of the generated table.
      See Also:
    • HLINE

      protected static final String HLINE
      LaTex code for a horizontal line to separate two rows.
      See Also:
    • HLINE_ROW

      public static final String HLINE_ROW
      LaTex code for a horizontal line to separate two rows as a pseudo row.
      See Also:
    • tableDef

      private final TableDefinition tableDef
      Style and column definitions of the table.
  • Constructor Details

    • TableGenerator

      public TableGenerator(TableDefinition tableDef)
      Constructs a TableGenerator constructing a table according to tableDef.
  • Method Details

    • generateTable

      public String generateTable(List<ContentRow> datasets, ContentRow ultimateResult)
      Convert datasets 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 the constructor.
      Parameters:
      datasets - the dataset to be converted
      ultimateResult - a summary row added according to the table definition
      Returns:
      the LaTex code for a table representing datasets
    • addHeader

      private static void addHeader(StringBuilder builder, Object val, String delim)
      Add a single header cell, annotating it appropriately. The macro resultTableHeader 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 added
      val - the content of the header cell
      delim - the delimiter between this cell and the next cell
    • addHeader

      public static void addHeader(StringBuilder builder, Object val)
      Adds a single header cell to the row builder with val as data. This cell can't be the last header in the row. In that case it has to added by addLastHeader(java.lang.StringBuilder,java.lang.Object).
    • addLastHeader

      public static void addLastHeader(StringBuilder builder, Object val)
      Adds the last header cell of the row builder with val as data.
    • addCell

      public static void addCell(StringBuilder builder, Object val)
      Adds a single cell to the row builder with val as data. This cell can't be the last cell in the row. In that case it has to added by addLastCell(java.lang.StringBuilder,java.lang.Object).
      See Also:
    • addLastCell

      public static void addLastCell(StringBuilder builder, Object val)
      Adds the last cell of the row builder with val as data.
      See Also:
    • alphabeticallySorted

      public static List<ContentRow> alphabeticallySorted(List<ContentRow> row)
      Returns a new alphabetically sorted list.