|
|||||||||
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.AbstractTextTableWriter
uk.ac.starlink.table.formats.IpacTableWriter
public class IpacTableWriter
A StarTableWriter which writes to the IPAC text format. The data format is defined at http://irsa.ipac.caltech.edu/applications/DDGEN/Doc/ipac_tbl.html.
Field Summary | |
---|---|
static java.lang.String |
NULL
String representation for null values. |
Constructor Summary | |
---|---|
IpacTableWriter()
Constructor. |
Method Summary | |
---|---|
java.lang.String |
formatValue(java.lang.Object val,
ValueInfo info,
int width)
Formats a data value for output. |
java.lang.String |
getFormatName()
Returns "IPAC". |
protected int |
getMaximumParameterLength()
The comments parameter may be many lines long. |
int |
getMaxWidth()
Returns the maximum width for a given column. |
java.lang.String |
getMimeType()
Returns "text/plain". |
int |
getMinNameWidth(ColumnInfo info)
Returns the minimum width required to output the actual characters of the name for a given column. |
boolean |
looksLikeFile(java.lang.String location)
Returns true for files with extension ".ipac" or ".tbl". |
void |
printColumnHeads(java.io.OutputStream out,
int[] colwidths,
ColumnInfo[] cinfos)
Outputs headings for the table columns. |
protected void |
printLine(java.io.OutputStream out,
int[] colwidths,
java.lang.String[] data)
Outputs a line of table data. |
protected void |
printParam(java.io.OutputStream out,
java.lang.String name,
java.lang.String value,
java.lang.Class clazz)
Outputs a parameter and its value. |
protected void |
printSeparator(java.io.OutputStream out,
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.AbstractTextTableWriter |
---|
getBytes, getSampledRows, getWriteParameters, 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 |
Field Detail |
---|
public static java.lang.String NULL
Constructor Detail |
---|
public IpacTableWriter()
Method Detail |
---|
public java.lang.String getFormatName()
getFormatName
in interface StarTableWriter
getFormatName
in class AbstractTextTableWriter
public java.lang.String getMimeType()
getMimeType
in interface StarTableWriter
getMimeType
in class AbstractTextTableWriter
public boolean looksLikeFile(java.lang.String location)
location
- the location name (probably filename)
public int getMaxWidth()
AbstractTextTableWriter
getMaxWidth
in class AbstractTextTableWriter
public int getMinNameWidth(ColumnInfo info)
AbstractTextTableWriter
AbstractTextTableWriter.printColumnHeads(java.io.OutputStream, int[], uk.ac.starlink.table.ColumnInfo[])
method does not need
to be included.
getMinNameWidth
in class AbstractTextTableWriter
info
- column metadata
public java.lang.String formatValue(java.lang.Object val, ValueInfo info, int width)
AbstractTextTableWriter
formatValue
in class AbstractTextTableWriter
val
- the valueinfo
- the metadata object describing val's typewidth
- maximum preferred width into which the value should
be formatted
public void printColumnHeads(java.io.OutputStream out, int[] colwidths, ColumnInfo[] cinfos) throws java.io.IOException
AbstractTextTableWriter
printColumnHeads
in class AbstractTextTableWriter
out
- stream to write intocolwidths
- column widths in characterscinfos
- array of column headings
java.io.IOException
protected void printLine(java.io.OutputStream out, int[] colwidths, java.lang.String[] data) throws java.io.IOException
AbstractTextTableWriter
printLine
in class AbstractTextTableWriter
out
- stream to write intocolwidths
- column widths in charactersdata
- array of strings to be output, one per column
java.io.IOException
protected void printSeparator(java.io.OutputStream out, int[] colwidths)
AbstractTextTableWriter
printSeparator
in class AbstractTextTableWriter
out
- stream to write intocolwidths
- column widths in charactersprotected void printParam(java.io.OutputStream out, java.lang.String name, java.lang.String value, java.lang.Class clazz) throws java.io.IOException
AbstractTextTableWriter
printParam
in class AbstractTextTableWriter
out
- stream to write intoname
- parameter namevalue
- formatted parameter valueclazz
- type of value
java.io.IOException
protected int getMaximumParameterLength()
getMaximumParameterLength
in class AbstractTextTableWriter
|
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 |