StarTableWriter
public class AsciiTableWriter extends AbstractTextTableWriter
AsciiStarTable
and AsciiTableBuilder
.Constructor | Description |
---|---|
AsciiTableWriter() |
Modifier and Type | Method | Description |
---|---|---|
protected java.lang.String |
formatValue(java.lang.Object val,
ValueInfo vinfo,
int width) |
Formats a data value for output.
|
java.lang.String |
getFormatName() |
Returns "ascii".
|
int |
getMaxWidth() |
Returns the maximum width for a given column.
|
boolean |
looksLikeFile(java.lang.String location) |
Returns true for if the location ends with "
.txt ". |
protected void |
printColumnHeads(java.io.OutputStream strm,
int[] colwidths,
ColumnInfo[] cinfos) |
Outputs headings for the table columns.
|
protected void |
printLine(java.io.OutputStream strm,
int[] colwidths,
java.lang.String[] data) |
Outputs a line of table data.
|
protected void |
printParam(java.io.OutputStream strm,
java.lang.String name,
java.lang.String value,
java.lang.Class clazz) |
Outputs a parameter and its value.
|
protected void |
printSeparator(java.io.OutputStream strm,
int[] colwidths) |
Outputs a decorative separator line, of the sort you might find
between the column headings and the table data.
|
getBytes, getMaximumParameterLength, getMimeType, getMinNameWidth, getSampledRows, getWriteParameters, setWriteParameters, writeStarTable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeStarTable
protected java.lang.String formatValue(java.lang.Object val, ValueInfo vinfo, int width)
AbstractTextTableWriter
formatValue
in class AbstractTextTableWriter
val
- the valuevinfo
- the metadata object describing val's typewidth
- maximum preferred width into which the value should
be formattedpublic java.lang.String getFormatName()
getFormatName
in interface StarTableWriter
getFormatName
in class AbstractTextTableWriter
public boolean looksLikeFile(java.lang.String location)
.txt
".location
- the location name (probably filename)public int getMaxWidth()
AbstractTextTableWriter
getMaxWidth
in class AbstractTextTableWriter
protected void printSeparator(java.io.OutputStream strm, int[] colwidths)
AbstractTextTableWriter
printSeparator
in class AbstractTextTableWriter
strm
- stream to write intocolwidths
- column widths in charactersprotected void printLine(java.io.OutputStream strm, int[] colwidths, java.lang.String[] data) throws java.io.IOException
AbstractTextTableWriter
printLine
in class AbstractTextTableWriter
strm
- stream to write intocolwidths
- column widths in charactersdata
- array of strings to be output, one per columnjava.io.IOException
protected void printColumnHeads(java.io.OutputStream strm, int[] colwidths, ColumnInfo[] cinfos) throws java.io.IOException
AbstractTextTableWriter
printColumnHeads
in class AbstractTextTableWriter
strm
- stream to write intocolwidths
- column widths in characterscinfos
- array of column headingsjava.io.IOException
protected void printParam(java.io.OutputStream strm, java.lang.String name, java.lang.String value, java.lang.Class clazz) throws java.io.IOException
AbstractTextTableWriter
printParam
in class AbstractTextTableWriter
strm
- stream to write intoname
- parameter namevalue
- formatted parameter valueclazz
- type of valuejava.io.IOException
Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.