Interface TableDefinition


  • public interface TableDefinition
    The definition of a table to display.

    Aa table definition contains a caption and data that describes each column. Every column in the table may have

    • A caption.
    • A TextStyle that describes the width of the entry, its offset from the previous column (leftPad) and how much each line after the first should be indented (indent).
    • A heading (String) is placed at the top of the column
    • A collection of rows
    Since:
    1.10.0
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String caption()
      Gets the caption for the table.
      java.util.List<TextStyle> columnTextStyles()
      Gets the list TextStyles.
      static TableDefinition from​(java.lang.String caption, java.util.List<TextStyle> columnStyle, java.util.List<java.lang.String> headers, java.lang.Iterable<java.util.List<java.lang.String>> rows)
      A helper function to create a table instance from the various components.
      java.util.List<java.lang.String> headers()
      Gets the list of header strings.
      java.lang.Iterable<java.util.List<java.lang.String>> rows()
      Gets the collection of rows.
    • Method Detail

      • from

        static TableDefinition from​(java.lang.String caption,
                                    java.util.List<TextStyle> columnStyle,
                                    java.util.List<java.lang.String> headers,
                                    java.lang.Iterable<java.util.List<java.lang.String>> rows)
        A helper function to create a table instance from the various components.
        Parameters:
        caption - The caption, may be null.
        columnStyle - a list of TextStyle elements defining the columns.
        headers - the list of column headers.
        rows - a collection of rows.
        Returns:
        A TableDefinition returning the parameters as appropriate.
      • caption

        java.lang.String caption()
        Gets the caption for the table. May be @{code null}.
        Returns:
        The caption for the table. May be @{code null}.
      • columnTextStyles

        java.util.List<TextStylecolumnTextStyles()
        Gets the list TextStyles. One for each column in order.
        Returns:
        the list of TextStyles.
      • headers

        java.util.List<java.lang.String> headers()
        Gets the list of header strings. One for each column in order.
        Returns:
        The list of header strings.
      • rows

        java.lang.Iterable<java.util.List<java.lang.String>> rows()
        Gets the collection of rows.

        Each row is a list of Strings, one for each column in the table.

        Returns:
        The collection of rows.