uk.ac.starlink.table.formats
Class PostgresAsciiStarTable
java.lang.Object
uk.ac.starlink.table.AbstractStarTable
uk.ac.starlink.table.formats.StreamStarTable
uk.ac.starlink.table.formats.PostgresAsciiStarTable
- All Implemented Interfaces:
- StarTable
- public class PostgresAsciiStarTable
- extends StreamStarTable
StarTable implementation which reads data from a pipe-separated-value
file. This is modelled on the ASCII form of the 2MASS catalogues
as distributed on the 2MASS catalogue DVD set, which claims to be
easy to ingest into PostgreSQL 7.3.2
(see ftp://ftp.ipac.caltech.edu/pub/2mass/allsky/
- Since:
- 12 Sep 2006
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 |
PostgresAsciiStarTable
public PostgresAsciiStarTable(DataSource datsrc,
URL schemaUrl)
throws IOException
- Constructor.
- Parameters:
datsrc
- input data sourceschemaUrl
- URL for 'schema' document which describes data
types (like twomass_psc_schema)
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:
IOException
- if I/O error is encountered
TableFormatException
- if the data doesn't represent this
kind of table
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:
IOException
- if I/O error is encountered
readSchema
protected ColumnInfo[] readSchema(InputStream in)
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:
in
- input stream for schema file
- Returns:
- column metadata array
- Throws:
IOException