Skip to content

Commit

Permalink
Introduces TableColumn.addColumn(columnTitle, columnSubTitle, format)
Browse files Browse the repository at this point in the history
to make it easier to set a format.

Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
  • Loading branch information
manoelcampos committed Nov 17, 2022
1 parent 45a5bf9 commit 8aecd9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ public final TableColumn addColumn(final String columnTitle, final String column
return addColumn(columnTitle).setSubTitle(columnSubTitle);
}

@Override
public TableColumn addColumn(final String columnTitle, final String columnSubTitle, final String format) {
return addColumn(columnTitle, columnSubTitle).setFormat(format);
}

@Override
public final TableColumn addColumn(final int index, final TableColumn column) {
columns.add(index, column);
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/org/cloudsimplus/builders/tables/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public interface Table {
* @return The created column.
* @see #addColumn(int, String)
* @see #addColumn(int, TableColumn)
* @see #addColumn(String, String, String)
*/
TableColumn addColumn(String columnTitle);

Expand All @@ -57,6 +58,7 @@ public interface Table {
* @return the created column
* @see #addColumn(String)
* @see #addColumn(int, TableColumn)
* @see #addColumn(String, String, String)
*/
TableColumn addColumn(int index, String columnTitle);

Expand All @@ -68,9 +70,23 @@ public interface Table {
* @return the created column
* @see #addColumn(String)
* @see #addColumn(int, String)
* @see #addColumn(String, String, String)
*/
TableColumn addColumn(String columnTitle, String columnSubTitle);

/**
* Adds a column with a given title and sub-title to the end of the table's columns to be printed.
*
* @param columnTitle The title of the column to be added.
* @param columnSubTitle The sub-title of the column to be added.
* @param format format to print the column data
* @return the created column
* @see #addColumn(String)
* @see #addColumn(int, String)
* @see #addColumn(int, TableColumn)
*/
TableColumn addColumn(String columnTitle, String columnSubTitle, String format);

/**
* Adds a column object to a specific position of the table's columns to be printed.
*
Expand Down

0 comments on commit 8aecd9c

Please sign in to comment.