Package org.cloudsimplus.builders.tables
Class CsvTableColumn
java.lang.Object
org.cloudsimplus.builders.tables.AbstractTableColumn
org.cloudsimplus.builders.tables.CsvTableColumn
- All Implemented Interfaces:
TableColumn
- Direct Known Subclasses:
MarkdownTableColumn
,TextTableColumn
A column of an CSV table. The class generates the CSV code
that represents a column in a CSV table.
- Since:
- CloudSim Plus 1.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A format used to print data followed by the column separator. -
Constructor Summary
ConstructorDescriptionCsvTableColumn
(String title) CsvTableColumn
(String title, String subTitle) CsvTableColumn
(Table table, String title) CsvTableColumn
(Table table, String title, String subTitle) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
alignStringRight
(String str) Align a string to the right side, based on the length of the title header of the column.static String
alignStringRight
(String str, int size) generateData
(Object data) Generates the string that represents the data of the column, formatted according to theformat
.protected String
generateHeader
(String str) Generates a header for the column, either for the title or subtitle header.Methods inherited from class org.cloudsimplus.builders.tables.AbstractTableColumn
generateSubtitleHeader, generateTitleHeader, getFormat, getIndex, getSubTitle, getTable, getTitle, isLastColumn, setFormat, setSubTitle, setTable, setTitle, toString
-
Field Details
-
DATA_COL_SEPARATOR_FORMAT
A format used to print data followed by the column separator.- See Also:
-
-
Constructor Details
-
CsvTableColumn
-
CsvTableColumn
-
CsvTableColumn
-
CsvTableColumn
-
-
Method Details
-
generateHeader
Description copied from class:AbstractTableColumn
Generates a header for the column, either for the title or subtitle header.- Specified by:
generateHeader
in classAbstractTableColumn
- Parameters:
str
- header title or subtitle- Returns:
- the generated header string
-
generateData
Description copied from class:AbstractTableColumn
Generates the string that represents the data of the column, formatted according to theformat
.- Specified by:
generateData
in interfaceTableColumn
- Overrides:
generateData
in classAbstractTableColumn
- Parameters:
data
- The data of the column to be formatted- Returns:
- a string containing the formatted column data
-
alignStringRight
Align a string to the right side, based on the length of the title header of the column.- Parameters:
str
- the string to be aligned- Returns:
- the aligned string
-
alignStringRight
-