Top Description Methods
io.github.kusoroadeolu.clique.components

public sealed Interface Table

extends Component
permits AbstractTable
Known Direct Implementers
io.github.kusoroadeolu.clique.components.AbstractTable
Annotations
@Stable
since:3.0.0
Imports
io.github.kusoroadeolu.clique.internal.documentation.Stable, java.util.Collection, .SequencedCollection

A component for displaying structured, multi-column data in the terminal.

Tables support multiple pre-defined styles (e.g., ASCII, Box-Draw) and dynamic content manipulation. This component does not support multi-line cell content; strings containing newlines may result in malformed output.

Markup Handling: Content added to cells is automatically processed via the configured MarkupParser.

Thread Safety: Implementations of this interface are not thread-safe. External synchronization is required if multiple threads access or modify the table structure concurrently.

Since
1.0.0

Method Summary

Modifier and TypeMethod and Description
public Table

Returns:

this table instance for method chaining
removeCell
(int
the 0-based row index
rowIndex
,
int
the 0-based column index
columnIndex
)

Removes the content of a specific cell and replaces it with the configured nullReplacement value.

public Table

Returns:

this table instance for method chaining
removeRow
(int
the 0-based index of the row to remove
rowIndex
)

Removes the row at the specified index.

public Table

Returns:

this table instance for method chaining
row
(String...
the cell contents for the new row
row
)

Appends a new row to the end of the table.

public Table

Returns:

this table instance for method chaining
row
(Collection<String>
the cell contents for the new row
row
)
Deprecated since 4.0.3. in favor of the SequencedCollection overload

Appends a new row to the end of the table.

public Table

Returns:

this table instance for method chaining
row
(SequencedCollection<String>
a collection of strings representing the cells of the row; must not be null
row
)

Appends a new row to the end of the table using the provided sequenced collection.

public Table

Returns:

this table instance for method chaining
updateCell
(int
the 0-based row index
rowIndex
,
int
the 0-based column index
columnIndex
,
String
the new content for the cell; must not be null
text
)

Updates the content of a specific cell.

Inherited from io.github.kusoroadeolu.clique.components.Component:
getrenderrender

Method Detail

removeCellback to summary
public Table removeCell(int rowIndex, int columnIndex)

Removes the content of a specific cell and replaces it with the configured nullReplacement value.

Parameters
rowIndex:int

the 0-based row index

columnIndex:int

the 0-based column index

Returns:Table

this table instance for method chaining

Exceptions
IndexOutOfBoundsException:
if row or column indices are out of range
removeRowback to summary
public Table removeRow(int rowIndex)

Removes the row at the specified index.

Scoping: Indices are 0-based. The header row (index 0) cannot be removed via this method.

Parameters
rowIndex:int

the 0-based index of the row to remove

Returns:Table

this table instance for method chaining

Exceptions
IndexOutOfBoundsException:
if the index is out of range
rowback to summary
public Table row(String... row)

Appends a new row to the end of the table.

Parameters
row:String[]

the cell contents for the new row

Returns:Table

this table instance for method chaining

Exceptions
NullPointerException:
if the varargs array or any element is null
rowback to summary
public Table row(Collection<String> row)

Deprecated

since 4.0.3.

in favor of the SequencedCollection overload

Appends a new row to the end of the table.

Parameters
row:Collection<String>

the cell contents for the new row

Returns:Table

this table instance for method chaining

Annotations
@Deprecated
since:4.0.3
Exceptions
NullPointerException:
if row or any element is null
rowback to summary
public Table row(SequencedCollection<String> row)

Appends a new row to the end of the table using the provided sequenced collection.

Parameters
row:SequencedCollection<String>

a collection of strings representing the cells of the row; must not be null

Returns:Table

this table instance for method chaining

Exceptions
NullPointerException:
if rows or any element is null
updateCellback to summary
public Table updateCell(int rowIndex, int columnIndex, String text)

Updates the content of a specific cell.

The provided text is immediately eligible for markup parsing during the next render cycle.

Parameters
rowIndex:int

the 0-based row index

columnIndex:int

the 0-based column index

text:String

the new content for the cell; must not be null

Returns:Table

this table instance for method chaining

Exceptions
NullPointerException:
if text is null
IndexOutOfBoundsException:
if row or column indices are out of range