Class AbstractTableColumn

java.lang.Object
org.cloudsimplus.builders.tables.AbstractTableColumn
All Implemented Interfaces:
TableColumn
Direct Known Subclasses:
CsvTableColumn, HtmlTableColumn, LatexTableColumn

public abstract class AbstractTableColumn extends Object implements TableColumn
An abstract column of a table to be generated using a Table class.
Author:
Manoel Campos da Silva Filho
  • Constructor Details

    • AbstractTableColumn

      public AbstractTableColumn(Table table, String title)
      Creates a column with a specific title.
      Parameters:
      table - the table that the column belongs to.
      title - the column title.
    • AbstractTableColumn

      public AbstractTableColumn(String title, String subTitle, String format)
      Creates a column with a specific title, subtitle and format.
      Parameters:
      title - the column title.
      subTitle - the column subtitle.
      format - the column format.
    • AbstractTableColumn

      public AbstractTableColumn(Table table, String title, String subTitle)
      Creates a column with a specific title and subtitle for a given table.
      Parameters:
      title - the column title.
      subTitle - the column subtitle.
    • AbstractTableColumn

      public AbstractTableColumn(String title, String subTitle)
      Creates a column with a specific title and subtitle.
      Parameters:
      title - the column title.
      subTitle - the column subtitle.
  • Method Details

    • setTitle

      public AbstractTableColumn setTitle(String title)
      Description copied from interface: TableColumn
      Sets the title of the table (optional).
      Specified by:
      setTitle in interface TableColumn
      Parameters:
      title - the title to set
      Returns:
      this column
    • setSubTitle

      public AbstractTableColumn setSubTitle(String subTitle)
      Description copied from interface: TableColumn
      Sets the subtitle of the table (optional).
      Specified by:
      setSubTitle in interface TableColumn
      Parameters:
      subTitle - the subtitle to set
      Returns:
      this column
    • setFormat

      public final AbstractTableColumn setFormat(String format)
      Description copied from interface: TableColumn
      Sets the format to print the column data.
      Specified by:
      setFormat in interface TableColumn
      Parameters:
      format - the format to set
      Returns:
      this column
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setTable

      public AbstractTableColumn setTable(Table table)
      Description copied from interface: TableColumn
      Sets the table this column belongs to.
      Specified by:
      setTable in interface TableColumn
      Parameters:
      table - the table to set
      Returns:
      this column
    • generateData

      public String generateData(Object data)
      Generates the string that represents the data of the column, formatted according to the format.
      Specified by:
      generateData in interface TableColumn
      Parameters:
      data - the data of the column to be formatted
      Returns:
      a string containing the formatted column data
    • generateHeader

      protected abstract String generateHeader(String str)
      Generates a header for the column, either for the title or subtitle header.
      Parameters:
      str - header title or subtitle
      Returns:
      the generated header string
    • generateTitleHeader

      public String generateTitleHeader()
      Description copied from interface: TableColumn
      Generates the string that represents the header of the column, containing the column title.
      Specified by:
      generateTitleHeader in interface TableColumn
      Returns:
      the generated header string
    • generateSubtitleHeader

      public String generateSubtitleHeader()
      Description copied from interface: TableColumn
      Generates the string that represents the sub-header of the column (if any), containing the column subtitle.
      Specified by:
      generateSubtitleHeader in interface TableColumn
      Returns:
      the generated sub-header string
    • getIndex

      public int getIndex()
      Description copied from interface: TableColumn
      Returns the index of the column into the table.
      Specified by:
      getIndex in interface TableColumn
      Returns:
      the index of the column into the table
    • isLastColumn

      protected boolean isLastColumn()
      Indicates if the current column is the last one in the column list of the Table.
      Returns:
      true if it is the last column, false otherwise.