Class AbstractTable
java.lang.Object
org.cloudsimplus.builders.tables.AbstractTable
- All Implemented Interfaces:
Table
- Direct Known Subclasses:
CsvTable,HtmlTable,LatexTable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final TableColumnaddColumn(TableColumn column) Adds a column to the end of the table.protected final TableColumnaddColumn(TableColumn column, int index) Adds a column at a given position of the table.final TableaddColumnList(String... columnTitles) Adds a list of columns (with given titles) to the end of the table's columns to be printed, where the column data will be printed without a specific format.intcolCount()Returns the number of columns.getRows()Returns the data to be printed.final TableColumnCreates a column with a given title.final TableColumnCreates a column with a given title and subtitle.newRow()Adds a new empty row to the list of rows, so that data can be added to the row further.voidprint()Prints the table.protected voidprotected abstract voidPrints the string to close the table.protected abstract voidPrints the string to open the table.protected abstract voidPrints the table title.protected abstract StringReturns the string to close a row.protected abstract StringReturns the string that has to precede each printed row.final TablesetColumnSeparator(@NonNull String columnSeparator) Sets the string used to separate one column from another.final TableReturns the table instance.protected abstract StringReturns the string that has to precede the subtitle head.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudsimplus.builders.tables.Table
getColumns, getColumnSeparator, getTitle, newColumn
-
Constructor Details
-
AbstractTable
public AbstractTable() -
AbstractTable
-
-
Method Details
-
colCount
-
setTitle
-
setColumnSeparator
Description copied from interface:TableSets the string used to separate one column from another. It's optional to set a column separator.- Specified by:
setColumnSeparatorin interfaceTable- Parameters:
columnSeparator- the separator- Returns:
- this table instance
-
getRows
-
newRow
-
print
-
printColumnHeaders
protected void printColumnHeaders() -
printTableOpening
protected abstract void printTableOpening()Prints the string to open the table. -
printTitle
protected abstract void printTitle()Prints the table title. -
rowOpening
Returns the string that has to precede each printed row.- Returns:
- the string that has to precede each printed row
-
rowClosing
Returns the string to close a row.- Returns:
- the string to close a row
-
subtitleHeaderOpening
Returns the string that has to precede the subtitle head.- Returns:
- the string that has to precede the subtitle head
-
printTableClosing
protected abstract void printTableClosing()Prints the string to close the table. -
addColumnList
Description copied from interface:TableAdds a list of columns (with given titles) to the end of the table's columns to be printed, where the column data will be printed without a specific format.- Specified by:
addColumnListin interfaceTable- Parameters:
columnTitles- The titles of the columns- Returns:
- the
Tableinstance. - See Also:
-
newColumn
Description copied from interface:TableCreates a column with a given title and subtitle. The created column is not added to the table. -
newColumn
Description copied from interface:TableCreates a column with a given title. The created column is not added to the table. -
addColumn
Adds a column to the end of the table.- Parameters:
column- the column to add- Returns:
- this table instance
-
addColumn
Adds a column at a given position of the table.- Parameters:
column- the column to addindex- the position in the table to add the column- Returns:
- this table instance
-