public class TextTableInfo extends Object
width
, line-separator
, and various other
meta-information for the layout of a textual table.LineWrapper
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_WIDTH
The default
width . |
private String |
lineSeparator |
private int |
width |
Constructor and Description |
---|
TextTableInfo()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getLineSeparator()
This method gets the
line separator used to terminate a line of text. |
int |
getWidth()
This method gets the width of the text-table in characters.
|
void |
setLineSeparator(String newline)
This method sets the
line-separator . |
void |
setWidth(int width) |
public static final int DEFAULT_WIDTH
width
. This default is suitable for a single-column layout.private String lineSeparator
private int width
public String getLineSeparator()
line separator
used to terminate a line of text. Only
the line-separator of the last column
is used and
all others are ignored.public void setLineSeparator(String newline)
line-separator
.newline
- is the new line-separator.StringUtil.getLineSeparator()
,
StringUtil.LINE_SEPARATOR_CR
,
StringUtil.LINE_SEPARATOR_CRLF
,
StringUtil.LINE_SEPARATOR_LF
,
StringUtil.LINE_SEPARATOR_LFCR
public int getWidth()
console
. It may be
TextColumnInfo.WIDTH_AUTO_ADJUST
if all column-widths
are set to actual
positive values. Otherwise the value returned by this method has to be positive and greater or equal to the sum of
the following term for each column
:
WhereTextColumnInfo.getBorderLeft()
.length() +TextColumnInfo.getBorderRight()
.length() + <column-with>
<column-with>
is TextColumnInfo.getWidth()
or (in case of
TextColumnInfo.WIDTH_AUTO_ADJUST
) an auto-calculated value that has to be greater or equal to 1. The
default value is 80.public void setWidth(int width)
width
- is the width to setCopyright © 2001–2016 mmm-Team. All rights reserved.