public final class TextTable extends Object
Constructor and Description |
---|
TextTable()
Creates a new text-based table with default table delimiters.
|
TextTable(char vert,
char horz,
char conn)
Creates a new text-based table using the given delimiters.
|
Modifier and Type | Method and Description |
---|---|
void |
addContent(int row,
int column,
Object object)
Adds to the
row -th row and the column -th column the content
object . |
void |
addContent(int row,
Object... objects)
Adds to the
row -th row a new column with content objects . |
void |
addHeader(int column,
Object object)
Adds a new header at position
column with content object . |
void |
addHeader(Object object)
Adds a new header with content
object at the end of the header row. |
void |
setColumnSpan(int row,
int from,
int to)
Spans a column span in the row
row ranging from from to
to (inclusive). |
void |
setHeaderSpan(int from,
int to)
Spans a column span in the header row ranging from
from to
to (inclusive). |
String |
toString() |
public TextTable()
TextTable(char, char, char)
public TextTable(char vert, char horz, char conn)
vert
- the vertical delimiterhorz
- the horizontal delimiterconn
- the connecting delimiter (used at connection points)public void addHeader(Object object)
object
at the end of the header row.object
- the content objectpublic void addHeader(int column, Object object)
column
with content object
.column
- the index of the column to which the header will be addedobject
- the content objectpublic void addContent(int row, Object... objects)
row
-th row a new column with content objects
.
If the table has less than row+1
rows, additional rows will be added.row
- the index of the rowobjects
- the content objects
public void addContent(int row, int column, Object object)
row
-th row and the column
-th column the content
object
. If the table has less than row+1
rows and/or less than
column+1
columns, additional rows and/or columns will be added.row
- the index of the rowcolumn
- the index of the columnobject
- the content objectpublic void setHeaderSpan(int from, int to)
from
to
to
(inclusive).from
- the index of the column in which the span startsto
- the index of the column in which the span endpublic void setColumnSpan(int row, int from, int to)
row
ranging from from
to
to
(inclusive).row
- the index of the rowfrom
- the index of the column in which the span startsto
- the index of the column in which the span end