Table.
This class uses a builder pattern for construction. Default values are:
CellAlign#LEFTMarkupParser#DEFAULTResolution Order: When determining cell alignment, configurations defined via
TableConfigurationBuilder#columnAlignment(int, CellAlign) take precedence over
the global TableConfigurationBuilder#alignment(CellAlign) setting.
Thread Safety: This class is immutable and thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| public static class | TableConfiguration.
Builder for |
| Modifier and Type | Field and Description |
|---|---|
| private final CellAlign | |
| private final AnsiCode[] | |
| private final Map | |
| public static final TableConfiguration | DEFAULT
The default table configuration. |
| private final String | |
| private final int | |
| private final MarkupParser |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static TableConfiguration. | Returns: a new builder instanceCreates a new builder for constructing a |
| public boolean | equals(Object object)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public CellAlign | Returns: the default cell alignmentReturns the global alignment setting for table cells. |
| public AnsiCode[] | Returns: a copy of the border color ANSI codesReturns the ANSI codes used to style the table borders. |
| public Map | Returns: a copy of the column alignment mapReturns the map of column-specific alignments. |
| public String | Returns: the null replacement stringReturns the string used to replace null cell values. |
| public int | Returns: the number of spaces used for paddingReturns the horizontal padding applied to cell content. |
| public MarkupParser | Returns: the markup parserReturns the parser used for resolving markup within cell content. |
| public int | |
| public String |
| alignment | back to summary |
|---|---|
| private final CellAlign alignment | |
| borderColor | back to summary |
|---|---|
| private final AnsiCode[] borderColor | |
| columnAlignment | back to summary |
|---|---|
| private final Map<Integer, CellAlign> columnAlignment | |
| DEFAULT | back to summary |
|---|---|
| public static final TableConfiguration DEFAULT The default table configuration. | |
| nullReplacement | back to summary |
|---|---|
| private final String nullReplacement | |
| padding | back to summary |
|---|---|
| private final int padding | |
| parser | back to summary |
|---|---|
| private final MarkupParser parser | |
| TableConfiguration | back to summary |
|---|---|
| private TableConfiguration() | |
| TableConfiguration | back to summary |
|---|---|
| private TableConfiguration(TableConfiguration. | |
| builder | back to summary |
|---|---|
| public static TableConfiguration. Creates a new builder for constructing a
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getAlignment | back to summary |
|---|---|
| public CellAlign getAlignment() Returns the global alignment setting for table cells.
| |
| getBorderColor | back to summary |
|---|---|
| public AnsiCode[] getBorderColor() Returns the ANSI codes used to style the table borders.
| |
| getColumnAlignment | back to summary |
|---|---|
| public Map Returns the map of column-specific alignments. | |
| getNullReplacement | back to summary |
|---|---|
| public String getNullReplacement() Returns the string used to replace null cell values.
| |
| getPadding | back to summary |
|---|---|
| public int getPadding() Returns the horizontal padding applied to cell content.
| |
| getParser | back to summary |
|---|---|
| public MarkupParser getParser() Returns the parser used for resolving markup within cell content.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
TableConfiguration instances.
This builder is not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private CellAlign | |
| private AnsiCode[] | |
| private Map | |
| private String | |
| private int | |
| private MarkupParser |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public TableConfiguration. | |
| public TableConfiguration. | Returns: this buildera string containing color tags e.g "red, bold". Note that the markup brackets should not be included borderColor)Sets the border color using a markup-styled string. |
| public TableConfiguration. | Returns: this builderthe ANSI codes to apply borderColor)Sets the border color using ANSI codes. |
| public TableConfiguration | Returns: a new configuration instanceBuilds a new |
| public TableConfiguration. | Returns: this builderthe mapping of column indices; must not be columnAlignment)nullSets column-specific alignments using a map of column indices to alignments. |
| public TableConfiguration. | Returns: this builderthe 0-based index of the column column, CellAlign the alignment to apply; must not be alignment)nullSets the alignment for a specific column. |
| public TableConfiguration. | Returns: this builderthe replacement string; must not be nullReplacement)nullSets the replacement string for cells containing |
| public TableConfiguration. | Returns: this builderthe number of spaces to apply; must not be negative padding)Sets the padding for table cells. |
| public TableConfiguration. | Returns: this builderthe parser to use; must not be parser)nullSets the parser for markup resolution. |
| alignment | back to summary |
|---|---|
| private CellAlign alignment | |
| borderColor | back to summary |
|---|---|
| private AnsiCode[] borderColor | |
| columnAlignment | back to summary |
|---|---|
| private Map<Integer, CellAlign> columnAlignment | |
| nullReplacement | back to summary |
|---|---|
| private String nullReplacement | |
| padding | back to summary |
|---|---|
| private int padding | |
| parser | back to summary |
|---|---|
| private MarkupParser parser | |
| TableConfigurationBuilder | back to summary |
|---|---|
| public TableConfigurationBuilder() | |
| alignment | back to summary |
|---|---|
| public TableConfiguration. Sets the default alignment for all table cells.
| |
| borderColor | back to summary |
|---|---|
| public TableConfiguration. Sets the border color using a markup-styled string.
| |
| borderColor | back to summary |
|---|---|
| public TableConfiguration. Sets the border color using ANSI codes.
| |
| build | back to summary |
|---|---|
| public TableConfiguration build() Builds a new
| |
| columnAlignment | back to summary |
|---|---|
| public TableConfiguration. Sets column-specific alignments using a map of column indices to alignments.
| |
| columnAlignment | back to summary |
|---|---|
| public TableConfiguration. Sets the alignment for a specific column. Scoping: This setting overrides the global table alignment for the specified column index.
| |
| nullReplacement | back to summary |
|---|---|
| public TableConfiguration. Sets the replacement string for cells containing
| |
| padding | back to summary |
|---|---|
| public TableConfiguration. Sets the padding for table cells.
| |
| parser | back to summary |
|---|---|
| public TableConfiguration. Sets the parser for markup resolution. content will be treated as literal text and will not be parsed into ANSI sequences.
| |