uk.ac.starlink.ttools.example
Class AllWiseAsciiStarTable
java.lang.Object
uk.ac.starlink.table.AbstractStarTable
uk.ac.starlink.table.formats.StreamStarTable
uk.ac.starlink.ttools.example.AllWiseAsciiStarTable
- All Implemented Interfaces:
- StarTable
public class AllWiseAsciiStarTable
- extends StreamStarTable
StarTable implementation which can read data from the AllWise data
release. At time of writing these files are available from
http://irsadist.ipac.caltech.edu/wise-allwise/.
The files are formatted as pipe-separated ASCII, and optionally compressed.
The metadata is stored in an external schema table file.
- Since:
- 6 Feb 2014
- Author:
- Mark Taylor
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 |
AllWiseAsciiStarTable
public AllWiseAsciiStarTable(DataSource datsrc,
URL schemaUrl,
long nrow)
throws IOException
- Constructor. You have to supply the number of rows that getRowCount
will report.
- Parameters:
datsrc
- input data sourceschemaUrl
- URL for 'schema' table which describes data typesnrow
- reported number of rows in table, -1 if unknown
- Throws:
IOException
readRow
protected List readRow(PushbackInputStream in)
throws TableFormatException,
IOException
- Description copied from class:
StreamStarTable
- 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:
TableFormatException
- if the data doesn't represent this
kind of table
IOException
- if I/O error is encountered
obtainMetadata
protected RowEvaluator.Metadata obtainMetadata()
throws IOException
- Obtains metadata for the table by reading the schema provided at
construction time.
- Specified by:
obtainMetadata
in class StreamStarTable
- Returns:
- information about the table represented by the character
stream
- Throws:
TableFormatException
- if the data doesn't represent this
kind of table
IOException
- if I/O error is encountered
readSchema
protected RowEvaluator.Metadata readSchema(DataSource datsrc)
throws IOException
- Given a PostgreSQL/2MASS-type schema file, works out what the
column metadata will look like for each column of the table.
- Parameters:
datsrc
- data source for schema file
- Returns:
- metadata object
- Throws:
IOException
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.