public class TableBuilderImpl extends Object implements TableBuilder
TableBuilder
interface.RowWidthAccessor.RowWidthBuilder<B extends RowWidthAccessor.RowWidthBuilder<?>>, RowWidthAccessor.RowWidthMutator, RowWidthAccessor.RowWidthProperty
Constructor and Description |
---|
TableBuilderImpl() |
TableBuilderImpl(int aRowWidth)
Initializes the
TableBuilder with the given row width. |
Modifier and Type | Method and Description |
---|---|
TableBuilder |
addColumn()
Adds a column and returns this
TableBuilder instance as of the
builder pattern. |
int |
getRowWidth() |
TableStatus |
getTableStatus()
Retrieves the
TablePrinter (TableBuilder ) status. |
void |
printHeader(String... aColumns)
Prints the table's header to the
PrintStream configured for this
PrintWriter with the content of the provided columns. |
void |
printHeaderBegin()
Prints out a header begin to the
PrintStream configured for this
PrintWriter , for convenience reasons, this is being encapsulated
by the TablePrinter.printHeader(String...) method. |
void |
printHeaderContinue(String... aColumns)
Continues to print out a begun header to the
PrintStream
configured for this PrintWriter , for convenience reasons, this is
being encapsulated by the TablePrinter.printHeader(String...) method. |
void |
printHeaderEnd()
Prints out a header end to the
PrintStream configured for this
PrintWriter , for convenience reasons, this is being encapsulated
by the TablePrinter.printHeader(String...) method. |
void |
printHeaderEnd(TableBuilder aTablePrinter)
Ends the headers of the provided
TableBuilder for this table
printer to continue to the PrintStream configured for this
PrintWriter ; different header widths and column widths are taken
care of, so it is a pleasure to mix different TableBuilder s,
especially when empty columns may result in better using another column
layout making better use of the available width. |
void |
printRow(String... aColumns)
Prints the table's (next) row to the
PrintStream configured for
this PrintWriter with the content of the provided columns. |
void |
printRowBegin()
Prints out a row begin to the
PrintStream configured for this
PrintWriter , for convenience reasons, this is being encapsulated
by the TablePrinter.printRow(String...) method. |
void |
printRowContinue(String... aColumns)
Continues a print out begun row to the
PrintStream configured for
this PrintWriter , for convenience reasons, this is being
encapsulated by the TablePrinter.printRow(String...) method. |
void |
printRowEnd(TableBuilder aTablePrinter)
Ends the rows of the provided
TableBuilder for this table printer
to continue to the PrintStream configured for this
PrintWriter ; different row widths and column widths are taken
care of, so it is a pleasure to mix different TableBuilder s,
especially when empty columns may result in better using another column
layout making better use of the available width. |
void |
printTail()
Finishes off the table by printing its closing to the
PrintStream
configured for this PrintWriter . |
TableBuilder |
setTableStatus(TableStatus aTableStatus)
Set the
TablePrinter (TableBuilder ) status. |
int[] |
toColumnWidths()
Returns the currently calculated or configured column widths.
|
String |
toHeader(String... aColumns)
Prints the table's header with the content of the provided columns.
|
String |
toHeaderBegin()
Begins a header, for convenience reasons, this is being encapsulated by
the
TablePrinter.toHeader(String...) method. |
String |
toHeaderContinue(String... aColumns)
Continues a begun header, for convenience reasons, this is being
encapsulated by the
TablePrinter.toHeader(String...) method. |
String |
toHeaderEnd()
Ends a header, for convenience reasons, this is being encapsulated by the
TablePrinter.toHeader(String...) method. |
String |
toHeaderEnd(TableBuilder aTablePrinter)
Ends the headers of the provided
TableBuilder for this table
printer to continue; different header widths and column widths are taken
care of, so it is a pleasure to mix different TableBuilder s,
especially when empty columns may result in better using another column
layout making better use of the available width. |
String |
toRow(String... aColumns)
Prints the table's (next) row with the content of the provided columns.
|
String |
toRowBegin()
Begins a row, for convenience reasons, this is being encapsulated by the
TablePrinter.toRow(String...) method. |
String |
toRowContinue(String... aColumns)
Continues a begun row, for convenience reasons, this is being
encapsulated by the
TablePrinter.toRow(String...) method. |
String |
toRowEnd(TableBuilder aTablePrinter)
Ends the rows of the provided
TableBuilder for this table printer
to continue; different row widths and column widths are taken care of, so
it is a pleasure to mix different TableBuilder s, especially when
empty columns may result in better using another column layout making
better use of the available width. |
String |
toTail()
Finishes off the table by closing it.
|
TableBuilder |
withAlignMode(TextAlignMode aTextAlignMode)
Sets an overall alignment mode for the header and the rows and returns
this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withBorderEscCode(String aAnsiEscCode)
Sets an overall ANSI escape code for the borders and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withColumnAlignMode(TextAlignMode aTextAlignMode)
Sets the column's alignment mode for the header and the rows and returns
this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withColumnEscCode(String aAnsiEscCode)
Sets the column's ANSI escape code for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withColumnFormatMode(TextFormatMode aTextFormatMode)
Sets the column's format mode for the header and the rows and returns
this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withColumnMoreMode(MoreTextMode aMoreTextMode)
Sets the column's "more" mode for the header and the rows and returns
this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withColumnSplitMode(LineSplitMode aLineSplitMode)
Sets the column's line split mode for the header and the rows and returns
this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withColumnWidth(ColumnWidth aColumnWidth)
Sets the current column's (the last added one with the
TableBuilder.addColumn() method) width and returns this TableBuilder
instance as of the builder pattern. |
TableBuilder |
withColumnWidth(int aWidth,
WidthType aWidthType)
Sets the current column's (the last added one with the
TableBuilder.addColumn() method) width and returns this TableBuilder
instance as of the builder pattern. |
TableBuilder |
withEscCodes(boolean isEscCodesEnabled)
Sets an overall ANSI escape code support for the
TableBuilder ,
for the rows as well as the borders; and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the header and the rows and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderAlignMode(TextAlignMode aTextAlignMode)
Sets an overall alignment mode for the header and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderColumnAlignMode(TextAlignMode aTextAlignMode)
Sets the column's header alignment mode for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderColumnEscCode(String aAnsiEscCode)
Sets the column's header ANSI escape code for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderColumnFormatMode(TextFormatMode aTextFormatMode)
Sets the column's header format mode for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderColumnMoreMode(MoreTextMode aMoreTextMode)
Sets the column's header "more" mode for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderColumnSplitMode(LineSplitMode aLineSplitMode)
Sets the column's header line split mode for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderEscCode(String aAnsiEscCode)
Sets an overall ANSI escape code for the header and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the header and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderMoreMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the header and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withHeaderSplitMode(LineSplitMode aLineSplitMode)
Sets an overall line split mode for the header and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withLeftBorder(boolean hasLeftBorder)
Sets whether to print the left border and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withLineBreak(String aLineBreak)
Sets the required line break and returns this
TableBuilder
instance as of the builder pattern. |
TableBuilder |
withMoreMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the header and the rows and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withPrintStream(PrintStream aPrintStream)
Sets the print stream to be used when using the print methods of the
TableBuilder and returns this TableBuilder instance as of
the builder pattern. |
TableBuilder |
withResetEscCode(String aAnsiEscCode)
Sets the ANSI reset escape code for this
TableBuilder instance as
of the builder pattern. |
TableBuilder |
withRightBorder(boolean hasRightBorder)
Sets whether to print the right border and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowAlignMode(TextAlignMode aTextAlignMode)
Sets an overall alignment mode for the rows and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowColumnAlignMode(TextAlignMode aTextAlignMode)
Sets the column's header alignment mode for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowColumnEscCode(String aAnsiEscCode)
Sets the column's header ANSI escape code for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowColumnFormatMode(TextFormatMode aTextFormatMode)
Sets the column's header format mode for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowColumnMoreMode(MoreTextMode aMoreTextMode)
Sets the column's header "more" mode for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowColumnSplitMode(LineSplitMode aLineSplitMode)
Sets the column's header line split mode for the header and the rows and
returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowEscCode(String aAnsiEscCode)
Sets an overall ANSI escape code for the rows and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowFormatMode(TextFormatMode aTextFormatMode)
Sets an overall format mode for the rows and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowMoreMode(MoreTextMode aMoreTextMode)
Sets an overall "more" mode for the rows and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowSplitMode(LineSplitMode aLineSplitMode)
Sets an overall line split mode for the rows and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withRowWidth(int aRowWidth) |
TableBuilder |
withSplitMode(LineSplitMode aLineSplitMode)
Sets an overall line split mode for the header and the rows and returns
this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withTableEscCode(String aAnsiEscCode)
Sets an overall ANSI escape code for the header, the rows as well as the
borders; and returns this
TableBuilder instance as of the builder
pattern. |
TableBuilder |
withTableStyle(TableStyle aTableStyle)
Sets the
TableStyle to use when printing and returns this
TableBuilder instance as of the builder pattern. |
TableBuilder |
withTextEscCode(String aAnsiEscCode)
Sets an overall ANSI escape code for the header and the rows and returns
this
TableBuilder instance as of the builder pattern. |
public TableBuilderImpl()
public TableBuilderImpl(int aRowWidth)
TableBuilder
with the given row width.aRowWidth
- The row width with which to initialize the
TableBuilder
.public int getRowWidth()
getRowWidth
in interface RowWidthAccessor
public TableStatus getTableStatus()
TablePrinter
TablePrinter
(TableBuilder
) status.
The TableStatus
is required by a TablePrinter
(
TableBuilder
) to determine whether to do additional table
decoration for a print operation or to fail that operation as of an
illegal state exception. As far as possible an illegal state exception is
to be tried to be prevented by decorating the table automatically by an
operation as of the current TableStatus
.getTableStatus
in interface TablePrinter
TableStatus
.public TableBuilder setTableStatus(TableStatus aTableStatus)
TablePrinter
TablePrinter
(TableBuilder
) status.
The TableStatus
is required by a TablePrinter
(
TableBuilder
) to determine whether to do additional table
decoration for a print operation or to fail that operation as of an
illegal state exception. As far as possible an illegal state exception is
to be tried to be prevented by decorating the table automatically by an
operation as of the current TableStatus
.
Setting the status manually, you can use differently configured
TablePrinter
interfaces to print their lines according to the
status of a previous TablePrinter
.setTableStatus
in interface TablePrinter
aTableStatus
- The table's current TableStatus
to be set.public TableBuilder withLeftBorder(boolean hasLeftBorder)
TableBuilder
TableBuilder
instance as of the builder pattern.withLeftBorder
in interface TableBuilder
hasLeftBorder
- True in case a left border is to be printed, elser
falseTableBuilder
instance to continue configuration.public TableBuilder withRightBorder(boolean hasRightBorder)
TableBuilder
TableBuilder
instance as of the builder pattern.withRightBorder
in interface TableBuilder
hasRightBorder
- True in case a right border is to be printed, elser
falseTableBuilder
instance to continue configuration.public TableBuilder withRowWidth(int aRowWidth)
withRowWidth
in interface RowWidthAccessor.RowWidthBuilder<TableBuilder>
public TableBuilder withTableStyle(TableStyle aTableStyle)
TableBuilder
TableStyle
to use when printing and returns this
TableBuilder
instance as of the builder pattern.withTableStyle
in interface TableBuilder
aTableStyle
- The TableStyle
defining the tables style to be
used when printing the table borders.TableBuilder
instance to continue configuration.public TableBuilder withLineBreak(String aLineBreak)
TableBuilder
TableBuilder
instance as of the builder pattern.withLineBreak
in interface TableBuilder
aLineBreak
- The line break character to use, by default the
platform specific one is used.TableBuilder
instance to continue configuration.public TableBuilder withPrintStream(PrintStream aPrintStream)
TableBuilder
TableBuilder
and returns this TableBuilder
instance as of
the builder pattern.withPrintStream
in interface TableBuilder
aPrintStream
- The PrintStream
to be used when printing out
the table.TableBuilder
instance to continue configuration.public TableBuilder withEscCodes(boolean isEscCodesEnabled)
TableBuilder
TableBuilder
,
for the rows as well as the borders; and returns this
TableBuilder
instance as of the builder pattern. In case of being
set to Boolean.FALSE
, then an ANSI support is disabled
altogether, else it is enabled. The latest setting wins.withEscCodes
in interface TableBuilder
isEscCodesEnabled
- True to enable, false to disable escape code
support altogether.TableBuilder
instance to continue configuration.public TableBuilder withTableEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
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.withTableEscCode
in interface TableBuilder
TableBuilder
instance to continue configuration.public TableBuilder withBorderEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
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.withBorderEscCode
in interface TableBuilder
TableBuilder
instance to continue configuration.public TableBuilder withTextEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
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.withTextEscCode
in interface TableBuilder
TableBuilder
instance to continue configuration.public TableBuilder withHeaderEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest ANSI
escape code being set wins.withHeaderEscCode
in interface TableBuilder
aAnsiEscCode
- The String
to be used for ANSI escaping the
text.TableBuilder
instance to continue configuration.public TableBuilder withRowEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest ANSI
escape code being set wins.withRowEscCode
in interface TableBuilder
aAnsiEscCode
- The String
to be used for ANSI escaping the
text.TableBuilder
instance to continue configuration.public TableBuilder withColumnEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest ANSI escape code being set wins.withColumnEscCode
in interface TableBuilder
aAnsiEscCode
- The String
to be used for ANSI escaping the
text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderColumnEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest ANSI escape code being set wins.withHeaderColumnEscCode
in interface TableBuilder
aAnsiEscCode
- The String
to be used for ANSI escaping the
text.TableBuilder
instance to continue configuration.public TableBuilder withRowColumnEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest ANSI escape code being set wins.withRowColumnEscCode
in interface TableBuilder
aAnsiEscCode
- The String
to be used for ANSI escaping the
text.TableBuilder
instance to continue configuration.public TableBuilder withResetEscCode(String aAnsiEscCode)
TableBuilder
TableBuilder
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.withResetEscCode
in interface TableBuilder
TableBuilder
instance to continue configuration.public TableBuilder withAlignMode(TextAlignMode aTextAlignMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
alignment mode being set wins.withAlignMode
in interface TableBuilder
aTextAlignMode
- The TextAlignMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withColumnAlignMode(TextAlignMode aTextAlignMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
alignment mode being set wins.withColumnAlignMode
in interface TableBuilder
aTextAlignMode
- The TextAlignMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderColumnAlignMode(TextAlignMode aTextAlignMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest alignment mode being set wins.withHeaderColumnAlignMode
in interface TableBuilder
aTextAlignMode
- The TextAlignMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withRowColumnAlignMode(TextAlignMode aTextAlignMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest alignment mode being set wins.withRowColumnAlignMode
in interface TableBuilder
aTextAlignMode
- The TextAlignMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderAlignMode(TextAlignMode aTextAlignMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
alignment mode being set wins.withHeaderAlignMode
in interface TableBuilder
aTextAlignMode
- The TextAlignMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withRowAlignMode(TextAlignMode aTextAlignMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
alignment mode being set wins.withRowAlignMode
in interface TableBuilder
aTextAlignMode
- The TextAlignMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withFormatMode(TextFormatMode aTextFormatMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
format mode being set wins.withFormatMode
in interface TableBuilder
aTextFormatMode
- The TextFormatMode
to be used for
formating the text.TableBuilder
instance to continue configuration.public TableBuilder withColumnFormatMode(TextFormatMode aTextFormatMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
format mode being set wins.withColumnFormatMode
in interface TableBuilder
aTextFormatMode
- The TextFormatMode
to be used for
formating the text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderColumnFormatMode(TextFormatMode aTextFormatMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest format mode being set wins.withHeaderColumnFormatMode
in interface TableBuilder
aTextFormatMode
- The TextFormatMode
to be used for
formating the text.TableBuilder
instance to continue configuration.public TableBuilder withRowColumnFormatMode(TextFormatMode aTextFormatMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest format mode being set wins.withRowColumnFormatMode
in interface TableBuilder
aTextFormatMode
- The TextFormatMode
to be used for
formating the text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderFormatMode(TextFormatMode aTextFormatMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
format mode being set wins.withHeaderFormatMode
in interface TableBuilder
aTextFormatMode
- The TextFormatMode
to be used for
formating the text.TableBuilder
instance to continue configuration.public TableBuilder withRowFormatMode(TextFormatMode aTextFormatMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
format mode being set wins.withRowFormatMode
in interface TableBuilder
aTextFormatMode
- The TextFormatMode
to be used for
formating the text.TableBuilder
instance to continue configuration.public TableBuilder withSplitMode(LineSplitMode aLineSplitMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
line split mode being set wins.withSplitMode
in interface TableBuilder
aLineSplitMode
- The LineSplitMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withColumnSplitMode(LineSplitMode aLineSplitMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
line split mode being set wins.withColumnSplitMode
in interface TableBuilder
aLineSplitMode
- The LineSplitMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderColumnSplitMode(LineSplitMode aLineSplitMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest line split mode being set wins.withHeaderColumnSplitMode
in interface TableBuilder
aLineSplitMode
- The LineSplitMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withRowColumnSplitMode(LineSplitMode aLineSplitMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest line split mode being set wins.withRowColumnSplitMode
in interface TableBuilder
aLineSplitMode
- The LineSplitMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderSplitMode(LineSplitMode aLineSplitMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest line
split mode being set wins.withHeaderSplitMode
in interface TableBuilder
aLineSplitMode
- The LineSplitMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withRowSplitMode(LineSplitMode aLineSplitMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest line
split mode being set wins.withRowSplitMode
in interface TableBuilder
aLineSplitMode
- The LineSplitMode
to be used for aligning
the text.TableBuilder
instance to continue configuration.public TableBuilder withMoreMode(MoreTextMode aMoreTextMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
"more" mode being set wins.withMoreMode
in interface TableBuilder
aMoreTextMode
- The MoreTextMode
to be used for aligning the
text.TableBuilder
instance to continue configuration.public TableBuilder withColumnMoreMode(MoreTextMode aMoreTextMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
"more" mode being set wins.withColumnMoreMode
in interface TableBuilder
aMoreTextMode
- The MoreTextMode
to be used for aligning the
text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderColumnMoreMode(MoreTextMode aMoreTextMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest "more" mode being set wins.withHeaderColumnMoreMode
in interface TableBuilder
aMoreTextMode
- The MoreTextMode
to be used for aligning the
text.TableBuilder
instance to continue configuration.public TableBuilder withRowColumnMoreMode(MoreTextMode aMoreTextMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The
latest "more" mode being set wins.withRowColumnMoreMode
in interface TableBuilder
aMoreTextMode
- The MoreTextMode
to be used for aligning the
text.TableBuilder
instance to continue configuration.public TableBuilder withHeaderMoreMode(MoreTextMode aMoreTextMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
"more" mode being set wins.withHeaderMoreMode
in interface TableBuilder
aMoreTextMode
- The MoreTextMode
to be used for aligning the
text.TableBuilder
instance to continue configuration.public TableBuilder withRowMoreMode(MoreTextMode aMoreTextMode)
TableBuilder
TableBuilder
instance as of the builder pattern. The latest
"more" mode being set wins.withRowMoreMode
in interface TableBuilder
aMoreTextMode
- The MoreTextMode
to be used for aligning the
text.TableBuilder
instance to continue configuration.public TableBuilder addColumn()
TableBuilder
TableBuilder
instance as of the
builder pattern.addColumn
in interface TableBuilder
TableBuilder
instance to continue configuration.public TableBuilder withColumnWidth(int aWidth, WidthType aWidthType) throws IllegalStateException
TableBuilder
TableBuilder.addColumn()
method) width and returns this TableBuilder
instance as of the builder pattern.withColumnWidth
in interface TableBuilder
aWidth
- The width for the column.aWidthType
- The type the width is of, e.g.
WidthType.RELATIVE
or WidthType.ABSOLUTE
TableBuilder
instance to continue configuration.IllegalStateException
- in case there is none column already added.public TableBuilder withColumnWidth(ColumnWidth aColumnWidth) throws IllegalStateException
TableBuilder
TableBuilder.addColumn()
method) width and returns this TableBuilder
instance as of the builder pattern.withColumnWidth
in interface TableBuilder
aColumnWidth
- The width and the WidthType
(
WidthType.RELATIVE
or WidthType.ABSOLUTE
) of the
column.TableBuilder
instance to continue configuration.IllegalStateException
- in case there is none column already added.public String toHeaderBegin()
TablePrinter
TablePrinter.toHeader(String...)
method. Use this method in case you need
more control on the header construction than TablePrinter.toHeader(String...)
can provide you.toHeaderBegin
in interface TablePrinter
String
including the line breaks.public String toHeaderContinue(String... aColumns)
TablePrinter
TablePrinter.toHeader(String...)
method. Use this method
in case you need more control on the header construction than
TablePrinter.toHeader(String...)
can provide you.toHeaderContinue
in interface TablePrinter
String
including the line
breaks.public String toHeaderEnd(TableBuilder aTablePrinter)
TablePrinter
TableBuilder
for this table
printer to continue; different header widths and column widths are taken
care of, so it is a pleasure to mix different TableBuilder
s,
especially when empty columns may result in better using another column
layout making better use of the available width.toHeaderEnd
in interface TablePrinter
aTablePrinter
- The TableBuilder
to which to append this
TableBuilder
's headers.TableBuilder
's layout with this (bottom)
TableBuilder
's layout.public String toHeaderEnd()
TablePrinter
TablePrinter.toHeader(String...)
method. Use this method in case you need
more control on the header construction than TablePrinter.toHeader(String...)
can provide you.toHeaderEnd
in interface TablePrinter
String
including the line breaks.public String toRowBegin()
TablePrinter
TablePrinter.toRow(String...)
method. Use this method in case you need more
control on the row construction than TablePrinter.toRow(String...)
can
provide you.toRowBegin
in interface TablePrinter
String
including the line breaks.public String toRowContinue(String... aColumns)
TablePrinter
TablePrinter.toRow(String...)
method. Use this method in
case you need more control on the header construction than
TablePrinter.toRow(String...)
can provide you.toRowContinue
in interface TablePrinter
String
including the line breaks.public String toRowEnd(TableBuilder aTablePrinter)
TablePrinter
TableBuilder
for this table printer
to continue; different row widths and column widths are taken care of, so
it is a pleasure to mix different TableBuilder
s, especially when
empty columns may result in better using another column layout making
better use of the available width.toRowEnd
in interface TablePrinter
aTablePrinter
- The TableBuilder
to which to append this
TableBuilder
's rows.TableBuilder
's
layout with this (bottom) TableBuilder
's layout.public String toHeader(String... aColumns)
TablePrinter
toHeader
in interface TablePrinter
aColumns
- The columns to be used in the table's header.String
including line breaks as it most
probably will consist of more than one line.public String toRow(String... aColumns)
TablePrinter
toRow
in interface TablePrinter
aColumns
- The columns to be used in the (next) table's row.String
including line breaks as it most probably
will consist of more than one line.public String toTail()
TablePrinter
toTail
in interface TablePrinter
public int[] toColumnWidths()
TableBuilder
toColumnWidths
in interface TableBuilder
public void printHeaderBegin()
TablePrinter
PrintStream
configured for this
PrintWriter
, for convenience reasons, this is being encapsulated
by the TablePrinter.printHeader(String...)
method. Use this method in case
you need more control on the header construction than
TablePrinter.printHeader(String...)
can provide you.printHeaderBegin
in interface TablePrinter
public void printHeaderContinue(String... aColumns)
TablePrinter
PrintStream
configured for this PrintWriter
, for convenience reasons, this is
being encapsulated by the TablePrinter.printHeader(String...)
method. Use
this method in case you need more control on the header construction than
TablePrinter.printHeader(String...)
can provide you.printHeaderContinue
in interface TablePrinter
public void printHeaderEnd(TableBuilder aTablePrinter)
TablePrinter
TableBuilder
for this table
printer to continue to the PrintStream
configured for this
PrintWriter
; different header widths and column widths are taken
care of, so it is a pleasure to mix different TableBuilder
s,
especially when empty columns may result in better using another column
layout making better use of the available width.printHeaderEnd
in interface TablePrinter
aTablePrinter
- The TableBuilder
to which to append this
TableBuilder
's headers.public void printHeaderEnd()
TablePrinter
PrintStream
configured for this
PrintWriter
, for convenience reasons, this is being encapsulated
by the TablePrinter.printHeader(String...)
method. Use this method in case
you need more control on the header construction than
TablePrinter.printHeader(String...)
can provide you.printHeaderEnd
in interface TablePrinter
public void printRowBegin()
TablePrinter
PrintStream
configured for this
PrintWriter
, for convenience reasons, this is being encapsulated
by the TablePrinter.printRow(String...)
method. Use this method in case you
need more control on the row construction than
TablePrinter.printRow(String...)
can provide you.printRowBegin
in interface TablePrinter
public void printRowContinue(String... aColumns)
TablePrinter
PrintStream
configured for
this PrintWriter
, for convenience reasons, this is being
encapsulated by the TablePrinter.printRow(String...)
method. Use this method
in case you need more control on the header construction than
TablePrinter.printRow(String...)
can provide you.printRowContinue
in interface TablePrinter
public void printRowEnd(TableBuilder aTablePrinter)
TablePrinter
TableBuilder
for this table printer
to continue to the PrintStream
configured for this
PrintWriter
; different row widths and column widths are taken
care of, so it is a pleasure to mix different TableBuilder
s,
especially when empty columns may result in better using another column
layout making better use of the available width.printRowEnd
in interface TablePrinter
aTablePrinter
- The TableBuilder
to which to append this
TableBuilder
's rows.public void printHeader(String... aColumns)
TablePrinter
PrintStream
configured for this
PrintWriter
with the content of the provided columns.printHeader
in interface TablePrinter
aColumns
- The columns to be used in the table's header.public void printRow(String... aColumns)
TablePrinter
PrintStream
configured for
this PrintWriter
with the content of the provided columns. Call
this method for each row to print out.printRow
in interface TablePrinter
aColumns
- The columns to be used in the (next) table's row.public void printTail()
TablePrinter
PrintStream
configured for this PrintWriter
.printTail
in interface TablePrinter
Copyright © 2015. All rights reserved.