AbstractTableColumn

public abstract class AbstractTableColumn implements TableColumn

A column of a table to be generated using a Table class.

Author:Manoel Campos da Silva Filho

Constructors

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)

Creates a column with a specific title and sub-title.

Parameters:
  • title – The column title.
  • subTitle – The column sub-title.

AbstractTableColumn

public AbstractTableColumn(Table table, String title, String subTitle)

Creates a column with a specific title and sub-title for a given table.

Parameters:
  • title – The column title.
  • subTitle – The column sub-title.

Methods

generateData

public String generateData(Object data)

Generates the string that represents the data of the column, formatted according to the format.

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

generateSubtitleHeader

public String generateSubtitleHeader()

generateTitleHeader

public String generateTitleHeader()

getFormat

public String getFormat()
Returns:The format to be used to display the content of the column, according to the String.format(java.lang.String,java.lang.Object...) (optional).

getIndex

protected int getIndex()
Returns:The index of the current column into the column list of the Table.

getSubTitle

public String getSubTitle()
Returns:The subtitle to be displayed below the title of the column (optional).

getTable

public Table getTable()
Returns:The table that the column belongs to.

getTitle

public String getTitle()
Returns:The title to be displayed at the top of the column.

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.

setFormat

public final AbstractTableColumn setFormat(String format)

setSubTitle

public AbstractTableColumn setSubTitle(String subTitle)

setTable

public AbstractTableColumn setTable(Table table)

setTitle

public AbstractTableColumn setTitle(String title)

toString

public String toString()