|
|||||||||
| 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 StarTableWritergetFormatName in class AbstractTextTableWriterpublic java.lang.String getMimeType()
getMimeType in interface StarTableWritergetMimeType in class AbstractTextTableWriterpublic boolean looksLikeFile(java.lang.String location)
location - the location name (probably filename)
public int getMaxWidth()
AbstractTextTableWriter
getMaxWidth in class AbstractTextTableWriterpublic int getMinNameWidth(ColumnInfo info)
AbstractTextTableWriterAbstractTextTableWriter.printColumnHeads(java.io.OutputStream, int[], uk.ac.starlink.table.ColumnInfo[]) method does not need
to be included.
getMinNameWidth in class AbstractTextTableWriterinfo - column metadata
public java.lang.String formatValue(java.lang.Object val,
ValueInfo info,
int width)
AbstractTextTableWriter
formatValue in class AbstractTextTableWriterval - 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 AbstractTextTableWriterout - 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 AbstractTextTableWriterout - 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 AbstractTextTableWriterout - stream to write intocolwidths - column widths in characters
protected 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 AbstractTextTableWriterout - stream to write intoname - parameter namevalue - formatted parameter valueclazz - type of value
java.io.IOExceptionprotected 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 | ||||||||