|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.util.table.TablePrinter
org.opends.server.util.table.TextTablePrinter
public final class TextTablePrinter
An interface for creating a text based table. Tables have configurable column widths, padding, and column separators.
Constructor Summary | |
---|---|
TextTablePrinter(java.io.OutputStream stream)
Creates a new text table printer for the specified output stream. |
|
TextTablePrinter(java.io.Writer writer)
Creates a new text table printer for the specified writer. |
Method Summary | |
---|---|
protected TableSerializer |
getSerializer()
Creates a new table serializer based on the configuration of this table printer. |
void |
setColumnSeparator(java.lang.String columnSeparator)
Sets the column separator which should be used to separate one column from the next (not including padding). |
void |
setColumnWidth(int column,
int width)
Set the maximum width for a column. |
void |
setDisplayHeadings(boolean displayHeadings)
Specify whether the column headings should be displayed or not. |
void |
setHeadingSeparator(char headingSeparator)
Sets the heading separator which should be used to separate the table heading row from the rows beneath. |
void |
setHeadingSeparatorStartColumn(int startColumn)
Sets the heading separator start column. |
void |
setIndentWidth(int indentWidth)
Sets the amount of characters that the table should be indented. |
void |
setPadding(int padding)
Sets the padding which will be used to separate a cell's contents from its adjacent column separators. |
void |
setTotalWidth(int totalWidth)
Sets the total permitted width for the table which expandable columns can use up. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextTablePrinter(java.io.OutputStream stream)
stream
- The stream to output tables to.public TextTablePrinter(java.io.Writer writer)
writer
- The writer to output tables to.Method Detail |
---|
public void setColumnSeparator(java.lang.String columnSeparator)
columnSeparator
- The column separator.public void setColumnWidth(int column, int width) throws java.lang.IllegalArgumentException
column
- The column to make fixed width (0 is the first column).width
- The width of the column (this should not include column
separators or padding), or 0
to indicate
that this column should be expandable.
java.lang.IllegalArgumentException
- If column is less than 0.public void setDisplayHeadings(boolean displayHeadings)
displayHeadings
- true
if column headings should be
displayed.public void setHeadingSeparator(char headingSeparator)
headingSeparator
- The heading separator.public void setHeadingSeparatorStartColumn(int startColumn)
startColumn
- The heading separator start column.public void setIndentWidth(int indentWidth) throws java.lang.IllegalArgumentException
indentWidth
- The number of characters the table should be indented.
java.lang.IllegalArgumentException
- If indentWidth is less than 0.public void setPadding(int padding)
padding
- The padding.public void setTotalWidth(int totalWidth)
totalWidth
- The total width.protected TableSerializer getSerializer()
getSerializer
in class TablePrinter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |