Package org.refcodes.textual
Interface TableBuilder
-
- All Superinterfaces:
org.refcodes.mixin.PrintStreamAccessor
,org.refcodes.mixin.PrintStreamAccessor.PrintStreamBuilder<TableBuilder>
,org.refcodes.mixin.PrintStreamAccessor.PrintStreamMutator
,org.refcodes.mixin.PrintStreamAccessor.PrintStreamProperty
,org.refcodes.mixin.RowWidthAccessor
,org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<TableBuilder>
,TablePrinter
- All Known Implementing Classes:
TableBuilderImpl
public interface TableBuilder extends TablePrinter, org.refcodes.mixin.RowWidthAccessor, org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<TableBuilder>, org.refcodes.mixin.PrintStreamAccessor.PrintStreamProperty, org.refcodes.mixin.PrintStreamAccessor.PrintStreamBuilder<TableBuilder>
The table printer has the Builder-Pattern applied to configure a text (ASCII) table for later printing custom tables with a title, the table rows and if required a table tail. As of the convention over configuration paradigm, reasonable default values are pre-configured in order to start right away; fine-tune your configuration with the provided builder methods.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.PrintStreamAccessor
org.refcodes.mixin.PrintStreamAccessor.PrintStreamBuilder<B extends org.refcodes.mixin.PrintStreamAccessor.PrintStreamBuilder<?>>, org.refcodes.mixin.PrintStreamAccessor.PrintStreamMutator, org.refcodes.mixin.PrintStreamAccessor.PrintStreamProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.RowWidthAccessor
org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<B extends org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<?>>, org.refcodes.mixin.RowWidthAccessor.RowWidthMutator, org.refcodes.mixin.RowWidthAccessor.RowWidthProperty
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TableBuilder
addColumn()
Adds a column and returns thisTableBuilder
instance as of the Builder-Pattern.default void
printHeader(java.lang.String... aColumns)
Prints the table's header to thePrintStream
configured for thisPrintWriter
with the content of the provided columns.default void
printHeaderBegin()
Prints out a header begin to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printHeader(String...)
method.default void
printHeaderContinue(java.lang.String... aColumns)
Continues to print out a begun header to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printHeader(String...)
method.default void
printHeaderEnd()
Prints out a header end to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printHeader(String...)
method.default void
printHeaderEnd(TableBuilder aTablePrinter)
Ends the headers of the providedTableBuilder
for this table printer to continue to thePrintStream
configured for thisPrintWriter
; different header widths and column widths are taken care of, so it is a pleasure to mix differentTableBuilder
s, especially when empty columns may result in better using another column layout making better use of the available width.default void
printRow(java.lang.String... aColumns)
Prints the table's (next) row to thePrintStream
configured for thisPrintWriter
with the content of the provided columns.default void
printRowBegin()
Prints out a row begin to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printRow(String...)
method.default void
printRowContinue(java.lang.String... aColumns)
Continues a print out begun row to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printRow(String...)
method.default void
printRowEnd(TableBuilder aTablePrinter)
Ends the rows of the providedTableBuilder
for this table printer to continue to thePrintStream
configured for thisPrintWriter
; different row widths and column widths are taken care of, so it is a pleasure to mix differentTableBuilder
s, especially when empty columns may result in better using another column layout making better use of the available width.default void
printTail()
Finishes off the table by printing its closing to thePrintStream
configured for thisPrintWriter
.int[]
toColumnWidths()
Returns the currently calculated or configured column widths.TableBuilder
withBorderEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the borders and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withColumnFormatMetrics(ColumnFormatMetrics aColumnFormatMetrics)
Sets the current column's (the last added one with theaddColumn()
method) format (including the width) and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withColumnHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets the column's alignment mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withColumnMoreTextMode(MoreTextMode aMoreTextMode)
Sets the column's "more" mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withColumnSplitTextMode(SplitTextMode aSplitTextMode)
Sets the column's line split mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withColumnTextFormatMode(TextFormatMode aTextFormatMode)
Sets the column's format mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withColumnWidth(int aWidth)
Sets the current column's (the last added one with theaddColumn()
method) absolute width () @link ColumnWidthType#ABSOLUTE) and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withColumnWidth(int aWidth, ColumnWidthType aWidthType)
Sets the current column's (the last added one with theaddColumn()
method) width and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withColumnWidthMetrics(ColumnWidthMetrics aColumnWidthMetrics)
Sets the current column's (the last added one with theaddColumn()
method) width and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the header, the rows as well as the borders; and returns thisTableBuilder
instance as of the builder pattern.TableBuilder
withEscapeCodes(boolean isEscapeCodesEnabled)
Sets an overall ANSI Escape-Code support for theTableBuilder
, for the rows as well as the borders; and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderColumnEscapeCode(java.lang.String aEscapeCode)
Sets the column's header ANSI Escape-Code for the current header column and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderColumnHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets the column's header alignment mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderColumnMoreTextMode(MoreTextMode aMoreTextMode)
Sets the column's header "more" mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderColumnSplitTextMode(SplitTextMode aSplitTextMode)
Sets the column's header line split mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderColumnTextFormatMode(TextFormatMode aTextFormatMode)
Sets the column's header format mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the header and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets an overall alignment mode for the header and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderMoreTextMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the header and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderSplitTextMode(SplitTextMode aSplitTextMode)
Sets an overall line split mode for the header and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHeaderTextFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the header and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets an overall alignment mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withLeftBorder(boolean hasLeftBorder)
Sets whether to print the left border and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withLineBreak(java.lang.String aLineBreak)
Sets the required line break and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withMoreTextMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.default TableBuilder
withPrintStream(java.io.PrintStream aPrintStream)
Sets the print stream to be used when using the print methods of theTableBuilder
and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withResetEscapeCode(java.lang.String aEscapeCode)
Sets the ANSI reset Escape-Code for thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRightBorder(boolean hasRightBorder)
Sets whether to print the right border and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowColumnEscapeCode(java.lang.String aEscapeCode)
Sets the column's header ANSI Escape-Code for the current row column and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowColumnHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets the column's header alignment mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowColumnMoreTextMode(MoreTextMode aMoreTextMode)
Sets the column's header "more" mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowColumnSplitTextMode(SplitTextMode aSplitTextMode)
Sets the column's header line split mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowColumnTextFormatMode(TextFormatMode aTextFormatMode)
Sets the column's row format mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets an overall alignment mode for the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowMoreTextMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowSplitTextMode(SplitTextMode aSplitTextMode)
Sets an overall line split mode for the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withRowTextFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withSplitTextMode(SplitTextMode aSplitTextMode)
Sets an overall line split mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withTableStyle(TableStyle aTableStyle)
Sets theTableStyle
to use when printing and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withTextColumnEscapeCode(java.lang.String aEscapeCode)
Sets the column's ANSI Escape-Code for the current (header and row) column and returns thisTableBuilder
instance as of the builder pattern.TableBuilder
withTextEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.TableBuilder
withTextFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern.-
Methods inherited from interface org.refcodes.mixin.PrintStreamAccessor.PrintStreamMutator
setPrintStream
-
Methods inherited from interface org.refcodes.textual.TablePrinter
getTableStatus, printHeader, printHeaderComplete, printHeaderContinue, printRow, printRowContinue, setTableStatus, toHeader, toHeader, toHeaderBegin, toHeaderComplete, toHeaderContinue, toHeaderContinue, toHeaderEnd, toHeaderEnd, toRow, toRow, toRowBegin, toRowContinue, toRowContinue, toRowEnd, toTail
-
-
-
-
Method Detail
-
addColumn
TableBuilder addColumn()
Adds a column and returns thisTableBuilder
instance as of the Builder-Pattern.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withColumnWidth
TableBuilder withColumnWidth(int aWidth, ColumnWidthType aWidthType) throws java.lang.IllegalStateException
Sets the current column's (the last added one with theaddColumn()
method) width and returns thisTableBuilder
instance as of the Builder-Pattern.- Parameters:
aWidth
- The width for the column.aWidthType
- The type the width is of, e.g.ColumnWidthType.RELATIVE
orColumnWidthType.ABSOLUTE
- Returns:
- This
TableBuilder
instance to continue configuration. - Throws:
java.lang.IllegalStateException
- in case there is none column already added.
-
withColumnWidth
TableBuilder withColumnWidth(int aWidth) throws java.lang.IllegalStateException
Sets the current column's (the last added one with theaddColumn()
method) absolute width () @link ColumnWidthType#ABSOLUTE) and returns thisTableBuilder
instance as of the Builder-Pattern. Same as calling "withColumnWidth(int, ColumnWidthType.ABSOLUTE)}"- Parameters:
aWidth
- The width for the column.- Returns:
- This
TableBuilder
instance to continue configuration. - Throws:
java.lang.IllegalStateException
- in case there is none column already added.
-
withColumnWidthMetrics
TableBuilder withColumnWidthMetrics(ColumnWidthMetrics aColumnWidthMetrics) throws java.lang.IllegalStateException
Sets the current column's (the last added one with theaddColumn()
method) width and returns thisTableBuilder
instance as of the Builder-Pattern.- Parameters:
aColumnWidthMetrics
- The width and theColumnWidthType
(ColumnWidthType.RELATIVE
orColumnWidthType.ABSOLUTE
) of the column.- Returns:
- This
TableBuilder
instance to continue configuration. - Throws:
java.lang.IllegalStateException
- in case there is none column already added.
-
withColumnFormatMetrics
TableBuilder withColumnFormatMetrics(ColumnFormatMetrics aColumnFormatMetrics) throws java.lang.IllegalStateException
Sets the current column's (the last added one with theaddColumn()
method) format (including the width) and returns thisTableBuilder
instance as of the Builder-Pattern.- Parameters:
aColumnFormatMetrics
- The width and theColumnWidthType
(ColumnWidthType.RELATIVE
orColumnWidthType.ABSOLUTE
) of the column as well as the format.- Returns:
- This
TableBuilder
instance to continue configuration. - Throws:
java.lang.IllegalStateException
- in case there is none column already added.
-
withLeftBorder
TableBuilder withLeftBorder(boolean hasLeftBorder)
Sets whether to print the left border and returns thisTableBuilder
instance as of the Builder-Pattern.- Parameters:
hasLeftBorder
- True in case a left border is to be printed, elser false- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRightBorder
TableBuilder withRightBorder(boolean hasRightBorder)
Sets whether to print the right border and returns thisTableBuilder
instance as of the Builder-Pattern.- Parameters:
hasRightBorder
- True in case a right border is to be printed, elser false- Returns:
- This
TableBuilder
instance to continue configuration.
-
withTableStyle
TableBuilder withTableStyle(TableStyle aTableStyle)
Sets theTableStyle
to use when printing and returns thisTableBuilder
instance as of the Builder-Pattern.- Parameters:
aTableStyle
- TheTableStyle
defining the tables style to be used when printing the table borders.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withLineBreak
TableBuilder withLineBreak(java.lang.String aLineBreak)
Sets the required line break and returns thisTableBuilder
instance as of the Builder-Pattern.- Parameters:
aLineBreak
- The line break character to use, by default the platform specific one is used.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withPrintStream
default TableBuilder withPrintStream(java.io.PrintStream aPrintStream)
Sets the print stream to be used when using the print methods of theTableBuilder
and returns thisTableBuilder
instance as of the Builder-Pattern.- Specified by:
withPrintStream
in interfaceorg.refcodes.mixin.PrintStreamAccessor.PrintStreamBuilder<TableBuilder>
- Parameters:
aPrintStream
- ThePrintStream
to be used when printing out the table.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withEscapeCodes
TableBuilder withEscapeCodes(boolean isEscapeCodesEnabled)
Sets an overall ANSI Escape-Code support for theTableBuilder
, for the rows as well as the borders; and returns thisTableBuilder
instance as of the Builder-Pattern. In case of being set toBoolean.FALSE
, then an ANSI support is disabled altogether, else it is enabled (again, if already configured). The latest setting wins.- Parameters:
isEscapeCodesEnabled
- True to enable, false to disable Escape-Code support altogether.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withEscapeCode
TableBuilder withEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the header, the rows as well as the borders; and returns thisTableBuilder
instance as of the builder pattern. In case an ANSI Escape-Codes is set, then an ANSI Reset-Code is prepended to the according text being printed. The latest ANSI escape code set wins.- Parameters:
aEscapeCode
- TheString
to be used for ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withBorderEscapeCode
TableBuilder withBorderEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the borders and returns thisTableBuilder
instance as of the Builder-Pattern. In case an ANSI Escape-Codes is set, then the ANSI Escape-Code is prepended and an ANSI Reset-Code is appended to the according text being printed. The latest ANSI Escape-Code set wins.- Parameters:
aEscapeCode
- TheString
to be used for ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withTextEscapeCode
TableBuilder withTextEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. In case an ANSI Escape-Codes is set, then the ANSI Escape-Code is prepended and an ANSI Reset-Code is appended to the according text being printed. The latest ANSI Escape-Code set wins.- Parameters:
aEscapeCode
- TheString
to be used for ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderEscapeCode
TableBuilder withHeaderEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the header and returns thisTableBuilder
instance as of the Builder-Pattern. The latest ANSI Escape-Code being set wins.- Parameters:
aEscapeCode
- TheString
to be used for ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowEscapeCode
TableBuilder withRowEscapeCode(java.lang.String aEscapeCode)
Sets an overall ANSI Escape-Code for the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest ANSI Escape-Code being set wins.- Parameters:
aEscapeCode
- TheString
to be used for ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withTextColumnEscapeCode
TableBuilder withTextColumnEscapeCode(java.lang.String aEscapeCode)
Sets the column's ANSI Escape-Code for the current (header and row) column and returns thisTableBuilder
instance as of the builder pattern. The latest ANSI Escape-Code being set wins.- Parameters:
aEscapeCode
- TheString
to be used for ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderColumnEscapeCode
TableBuilder withHeaderColumnEscapeCode(java.lang.String aEscapeCode)
Sets the column's header ANSI Escape-Code for the current header column and returns thisTableBuilder
instance as of the Builder-Pattern. The latest ANSI Escape-Code being set wins.- Parameters:
aEscapeCode
- TheString
to be used for ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowColumnEscapeCode
TableBuilder withRowColumnEscapeCode(java.lang.String aEscapeCode)
Sets the column's header ANSI Escape-Code for the current row column and returns thisTableBuilder
instance as of the Builder-Pattern. The latest ANSI Escape-Code being set wins.- Parameters:
aEscapeCode
- TheString
to be used for ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withResetEscapeCode
TableBuilder withResetEscapeCode(java.lang.String aEscapeCode)
Sets the ANSI reset Escape-Code for thisTableBuilder
instance as of the Builder-Pattern. In case an ANSI Escape-Codes is set, then this ANSI Reset-Code is prepended to the according text being printed.- Parameters:
aEscapeCode
- TheString
to be used for resetting ANSI escaping.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHorizAlignTextMode
TableBuilder withHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets an overall alignment mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest alignment mode being set wins.- Parameters:
aHorizAlignTextMode
- TheHorizAlignTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderHorizAlignTextMode
TableBuilder withHeaderHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets an overall alignment mode for the header and returns thisTableBuilder
instance as of the Builder-Pattern. The latest alignment mode being set wins.- Parameters:
aHorizAlignTextMode
- TheHorizAlignTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowHorizAlignTextMode
TableBuilder withRowHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets an overall alignment mode for the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest alignment mode being set wins.- Parameters:
aHorizAlignTextMode
- TheHorizAlignTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withColumnHorizAlignTextMode
TableBuilder withColumnHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets the column's alignment mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest alignment mode being set wins.- Parameters:
aHorizAlignTextMode
- TheHorizAlignTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderColumnHorizAlignTextMode
TableBuilder withHeaderColumnHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets the column's header alignment mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest alignment mode being set wins.- Parameters:
aHorizAlignTextMode
- TheHorizAlignTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowColumnHorizAlignTextMode
TableBuilder withRowColumnHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets the column's header alignment mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest alignment mode being set wins.- Parameters:
aHorizAlignTextMode
- TheHorizAlignTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withTextFormatMode
TableBuilder withTextFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest format mode being set wins.- Parameters:
aTextFormatMode
- TheTextFormatMode
to be used for formating the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderTextFormatMode
TableBuilder withHeaderTextFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the header and returns thisTableBuilder
instance as of the Builder-Pattern. The latest format mode being set wins.- Parameters:
aTextFormatMode
- TheTextFormatMode
to be used for formating the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowTextFormatMode
TableBuilder withRowTextFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest format mode being set wins.- Parameters:
aTextFormatMode
- TheTextFormatMode
to be used for formating the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withColumnTextFormatMode
TableBuilder withColumnTextFormatMode(TextFormatMode aTextFormatMode)
Sets the column's format mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest format mode being set wins.- Parameters:
aTextFormatMode
- TheTextFormatMode
to be used for formating the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderColumnTextFormatMode
TableBuilder withHeaderColumnTextFormatMode(TextFormatMode aTextFormatMode)
Sets the column's header format mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest format mode being set wins.- Parameters:
aTextFormatMode
- TheTextFormatMode
to be used for formating the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowColumnTextFormatMode
TableBuilder withRowColumnTextFormatMode(TextFormatMode aTextFormatMode)
Sets the column's row format mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest format mode being set wins.- Parameters:
aTextFormatMode
- TheTextFormatMode
to be used for formating the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withSplitTextMode
TableBuilder withSplitTextMode(SplitTextMode aSplitTextMode)
Sets an overall line split mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest line split mode being set wins.- Parameters:
aSplitTextMode
- TheSplitTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderSplitTextMode
TableBuilder withHeaderSplitTextMode(SplitTextMode aSplitTextMode)
Sets an overall line split mode for the header and returns thisTableBuilder
instance as of the Builder-Pattern. The latest line split mode being set wins.- Parameters:
aSplitTextMode
- TheSplitTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowSplitTextMode
TableBuilder withRowSplitTextMode(SplitTextMode aSplitTextMode)
Sets an overall line split mode for the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest line split mode being set wins.- Parameters:
aSplitTextMode
- TheSplitTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withColumnSplitTextMode
TableBuilder withColumnSplitTextMode(SplitTextMode aSplitTextMode)
Sets the column's line split mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest line split mode being set wins.- Parameters:
aSplitTextMode
- TheSplitTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderColumnSplitTextMode
TableBuilder withHeaderColumnSplitTextMode(SplitTextMode aSplitTextMode)
Sets the column's header line split mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest line split mode being set wins.- Parameters:
aSplitTextMode
- TheSplitTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowColumnSplitTextMode
TableBuilder withRowColumnSplitTextMode(SplitTextMode aSplitTextMode)
Sets the column's header line split mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest line split mode being set wins.- Parameters:
aSplitTextMode
- TheSplitTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withMoreTextMode
TableBuilder withMoreTextMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest "more" mode being set wins.- Parameters:
aMoreTextMode
- TheMoreTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderMoreTextMode
TableBuilder withHeaderMoreTextMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the header and returns thisTableBuilder
instance as of the Builder-Pattern. The latest "more" mode being set wins.- Parameters:
aMoreTextMode
- TheMoreTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowMoreTextMode
TableBuilder withRowMoreTextMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest "more" mode being set wins.- Parameters:
aMoreTextMode
- TheMoreTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withColumnMoreTextMode
TableBuilder withColumnMoreTextMode(MoreTextMode aMoreTextMode)
Sets the column's "more" mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest "more" mode being set wins.- Parameters:
aMoreTextMode
- TheMoreTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withHeaderColumnMoreTextMode
TableBuilder withHeaderColumnMoreTextMode(MoreTextMode aMoreTextMode)
Sets the column's header "more" mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest "more" mode being set wins.- Parameters:
aMoreTextMode
- TheMoreTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
withRowColumnMoreTextMode
TableBuilder withRowColumnMoreTextMode(MoreTextMode aMoreTextMode)
Sets the column's header "more" mode for the header and the rows and returns thisTableBuilder
instance as of the Builder-Pattern. The latest "more" mode being set wins.- Parameters:
aMoreTextMode
- TheMoreTextMode
to be used for aligning the text.- Returns:
- This
TableBuilder
instance to continue configuration.
-
toColumnWidths
int[] toColumnWidths()
Returns the currently calculated or configured column widths. Changing the row width or adding a column will affect the result being returned.- Returns:
- The widths of the rows as currently calculated.
-
printHeaderBegin
default void printHeaderBegin()
Prints out a header begin to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printHeader(String...)
method. Use this method in case you need more control on the header construction thanTablePrinter.printHeader(String...)
can provide you.- Specified by:
printHeaderBegin
in interfaceTablePrinter
-
printHeaderContinue
default void printHeaderContinue(java.lang.String... aColumns)
Continues to print out a begun header to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printHeader(String...)
method. Use this method in case you need more control on the header construction thanTablePrinter.printHeader(String...)
can provide you.- Specified by:
printHeaderContinue
in interfaceTablePrinter
- Parameters:
aColumns
- the columns
-
printHeaderEnd
default void printHeaderEnd(TableBuilder aTablePrinter)
Ends the headers of the providedTableBuilder
for this table printer to continue to thePrintStream
configured for thisPrintWriter
; different header widths and column widths are taken care of, so it is a pleasure to mix differentTableBuilder
s, especially when empty columns may result in better using another column layout making better use of the available width.- Specified by:
printHeaderEnd
in interfaceTablePrinter
- Parameters:
aTablePrinter
- TheTableBuilder
to which to append thisTableBuilder
's headers.
-
printHeaderEnd
default void printHeaderEnd()
Prints out a header end to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printHeader(String...)
method. Use this method in case you need more control on the header construction thanTablePrinter.printHeader(String...)
can provide you.- Specified by:
printHeaderEnd
in interfaceTablePrinter
-
printRowBegin
default void printRowBegin()
Prints out a row begin to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printRow(String...)
method. Use this method in case you need more control on the row construction thanTablePrinter.printRow(String...)
can provide you.- Specified by:
printRowBegin
in interfaceTablePrinter
-
printRowContinue
default void printRowContinue(java.lang.String... aColumns)
Continues a print out begun row to thePrintStream
configured for thisPrintWriter
, for convenience reasons, this is being encapsulated by theTablePrinter.printRow(String...)
method. Use this method in case you need more control on the header construction thanTablePrinter.printRow(String...)
can provide you.- Specified by:
printRowContinue
in interfaceTablePrinter
- Parameters:
aColumns
- the columns
-
printRowEnd
default void printRowEnd(TableBuilder aTablePrinter)
Ends the rows of the providedTableBuilder
for this table printer to continue to thePrintStream
configured for thisPrintWriter
; different row widths and column widths are taken care of, so it is a pleasure to mix differentTableBuilder
s, especially when empty columns may result in better using another column layout making better use of the available width.- Specified by:
printRowEnd
in interfaceTablePrinter
- Parameters:
aTablePrinter
- TheTableBuilder
to which to append thisTableBuilder
's rows.
-
printHeader
default void printHeader(java.lang.String... aColumns)
Prints the table's header to thePrintStream
configured for thisPrintWriter
with the content of the provided columns.- Specified by:
printHeader
in interfaceTablePrinter
- Parameters:
aColumns
- The columns to be used in the table's header.
-
printRow
default void printRow(java.lang.String... aColumns)
Prints the table's (next) row to thePrintStream
configured for thisPrintWriter
with the content of the provided columns. Call this method for each row to print out.- Specified by:
printRow
in interfaceTablePrinter
- Parameters:
aColumns
- The columns to be used in the (next) table's row.
-
printTail
default void printTail()
Finishes off the table by printing its closing to thePrintStream
configured for thisPrintWriter
.- Specified by:
printTail
in interfaceTablePrinter
-
-