Package net.minecraftforge.common.util
Class TextTable
java.lang.Object
net.minecraftforge.common.util.TextTable
Utility to format data into a textual (markdown-compliant) table.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<TextTable.Column> private final List
<TextTable.Row> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
append
(StringBuilder destination, String lineEnding) Appends the data formatted as a table to the given string builder.void
clear()
static TextTable.Column
static TextTable.Column
column
(String header, TextTable.Alignment alignment) private void
printRow
(StringBuilder destination, List<String> values) private void
printSeparators
(StringBuilder destination)
-
Field Details
-
columns
-
rows
-
-
Constructor Details
-
TextTable
-
-
Method Details
-
column
-
column
-
build
-
append
Appends the data formatted as a table to the given string builder. The padding character used for the column alignments is a single space (' '), the separate between column headers and values is a dash ('-'). Note that you *have* to specify a line ending, '\n' isn't used by default.The generated table is compliant with the markdown file format.
- Parameters:
destination
- a string builder to append the table tolineEnding
- the line ending to use for each row of the table
-
printSeparators
-
printRow
-
add
-
clear
public void clear() -
getColumns
-