|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.StreamStarTableWriter
uk.ac.starlink.table.formats.TextTableWriter
uk.ac.starlink.table.formats.AsciiTableWriter
A StarTableWriter which outputs text to a simple format machine-readable
text file. This format is suitable for reading using
AsciiStarTable
and AsciiTableBuilder
.
Constructor Summary | |
AsciiTableWriter()
|
Method Summary | |
protected String |
formatValue(Object val,
ValueInfo vinfo,
int width)
Formats a data value for output. |
String |
getFormatName()
Returns "ascii". |
int |
getMaxWidth()
Returns the maximum width for a given column. |
protected void |
printColumnHeads(OutputStream strm,
int[] colwidths,
ColumnInfo[] cinfos)
Outputs headings for the table columns. |
protected void |
printLine(OutputStream strm,
int[] colwidths,
String[] data)
Outputs a line of table data. |
protected void |
printParam(OutputStream strm,
String name,
String value)
Outputs a parameter and its value. |
protected void |
printSeparator(OutputStream strm,
int[] colwidths)
Outputs a decorative separator line, of the sort you might find between the column headings and the table data. |
Methods inherited from class uk.ac.starlink.table.formats.TextTableWriter |
getBytes, getMimeType, getSampledRows, getWriteParameters, looksLikeFile, setWriteParameters, writeStarTable |
Methods inherited from class uk.ac.starlink.table.StreamStarTableWriter |
writeStarTable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AsciiTableWriter()
Method Detail |
protected String formatValue(Object val, ValueInfo vinfo, int width)
TextTableWriter
formatValue
in class TextTableWriter
val
- the valuevinfo
- the metadata object describing val's typewidth
- maximum preferred width into which the value should
be formatted
public String getFormatName()
getFormatName
in interface StarTableWriter
getFormatName
in class TextTableWriter
public int getMaxWidth()
TextTableWriter
getMaxWidth
in class TextTableWriter
protected void printSeparator(OutputStream strm, int[] colwidths)
TextTableWriter
printSeparator
in class TextTableWriter
strm
- stream to write intocolwidths
- column widths in charactersprotected void printLine(OutputStream strm, int[] colwidths, String[] data) throws IOException
TextTableWriter
printLine
in class TextTableWriter
strm
- stream to write intocolwidths
- column widths in charactersdata
- array of strings to be output, one per column
IOException
protected void printColumnHeads(OutputStream strm, int[] colwidths, ColumnInfo[] cinfos) throws IOException
TextTableWriter
printColumnHeads
in class TextTableWriter
strm
- stream to write intocolwidths
- column widths in characterscinfos
- array of column headings
IOException
protected void printParam(OutputStream strm, String name, String value) throws IOException
TextTableWriter
printParam
in class TextTableWriter
strm
- stream to write intoname
- parameter namevalue
- formatted parameter value
IOException
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |