|
|||||||||
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 String |
NULL
String representation for null values. |
Constructor Summary | |
---|---|
IpacTableWriter()
Constructor. |
Method Summary | |
---|---|
String |
formatValue(Object val,
ValueInfo info,
int width)
Formats a data value for output. |
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. |
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(String location)
Returns true for files with extension ".ipac" or ".tbl". |
void |
printColumnHeads(OutputStream out,
int[] colwidths,
ColumnInfo[] cinfos)
Outputs headings for the table columns. |
protected void |
printLine(OutputStream out,
int[] colwidths,
String[] data)
Outputs a line of table data. |
protected void |
printParam(OutputStream out,
String name,
String value,
Class clazz)
Outputs a parameter and its value. |
protected void |
printSeparator(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 String NULL
Constructor Detail |
---|
public IpacTableWriter()
Method Detail |
---|
public String getFormatName()
getFormatName
in interface StarTableWriter
getFormatName
in class AbstractTextTableWriter
public String getMimeType()
getMimeType
in interface StarTableWriter
getMimeType
in class AbstractTextTableWriter
public boolean looksLikeFile(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 String formatValue(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(OutputStream out, int[] colwidths, ColumnInfo[] cinfos) throws IOException
AbstractTextTableWriter
printColumnHeads
in class AbstractTextTableWriter
out
- stream to write intocolwidths
- column widths in characterscinfos
- array of column headings
IOException
protected void printLine(OutputStream out, int[] colwidths, String[] data) throws IOException
AbstractTextTableWriter
printLine
in class AbstractTextTableWriter
out
- stream to write intocolwidths
- column widths in charactersdata
- array of strings to be output, one per column
IOException
protected void printSeparator(OutputStream out, int[] colwidths)
AbstractTextTableWriter
printSeparator
in class AbstractTextTableWriter
out
- stream to write intocolwidths
- column widths in charactersprotected void printParam(OutputStream out, String name, String value, Class clazz) throws IOException
AbstractTextTableWriter
printParam
in class AbstractTextTableWriter
out
- stream to write intoname
- parameter namevalue
- formatted parameter valueclazz
- type of value
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 |