uk.ac.starlink.table.formats
Class AsciiStarTable

java.lang.Object
  extended byuk.ac.starlink.table.AbstractStarTable
      extended byuk.ac.starlink.table.formats.StreamStarTable
          extended byuk.ac.starlink.table.formats.AsciiStarTable
All Implemented Interfaces:
StarTable

public class AsciiStarTable
extends StreamStarTable

Simple ASCII-format table. This reader attempts to make sensible decisions about what is a table and what is not, but inevitably it will not be able to read ASCII tables in any format.

Here are the rules:


Field Summary
 
Fields inherited from class uk.ac.starlink.table.formats.StreamStarTable
END
 
Constructor Summary
AsciiStarTable(DataSource datsrc)
          Constructs a new AsciiStarTable from a datasource.
 
Method Summary
protected  RowEvaluator.Metadata obtainMetadata()
          Obtains column metadata for this table, probably by reading through the rows once and using a RowEvaluator.
protected  List readRow(PushbackInputStream in)
          Reads the next row of data from a given stream.
 
Methods inherited from class uk.ac.starlink.table.formats.StreamStarTable
getColumnCount, getColumnInfo, getInputStream, getRowCount, getRowSequence, init
 
Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, getCell, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getRow, getURL, isRandom, setName, setParameter, setParameters, setURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsciiStarTable

public AsciiStarTable(DataSource datsrc)
               throws TableFormatException,
                      IOException
Constructs a new AsciiStarTable from a datasource.

Parameters:
datsrc - the data source containing the table text
Throws:
TableFormatException - if the input stream doesn't appear to form a ASCII-format table
IOException - if some I/O error occurs
Method Detail

obtainMetadata

protected RowEvaluator.Metadata obtainMetadata()
                                        throws TableFormatException,
                                               IOException
Description copied from class: StreamStarTable
Obtains column metadata for this table, probably by reading through the rows once and using a RowEvaluator.

Specified by:
obtainMetadata in class StreamStarTable
Returns:
information about the table represented by the character stream
Throws:
IOException - if I/O error is encountered
TableFormatException - if the data doesn't represent this kind of table

readRow

protected List readRow(PushbackInputStream in)
                throws IOException
Reads the next row of data from a given stream. Ignorable rows are skipped; comments may be stashed away.

Specified by:
readRow in class StreamStarTable
Parameters:
in - input stream
Returns:
list of Strings one for each cell in the row, or null for end of stream
Throws:
IOException - if I/O error is encountered

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.