Package uk.ac.starlink.ttools.example
Class PostgresAsciiStarTable
- java.lang.Object
-
- uk.ac.starlink.table.AbstractStarTable
-
- uk.ac.starlink.table.formats.StreamStarTable
-
- uk.ac.starlink.ttools.example.PostgresAsciiStarTable
-
- All Implemented Interfaces:
uk.ac.starlink.table.StarTable
public class PostgresAsciiStarTable extends uk.ac.starlink.table.formats.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
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description PostgresAsciiStarTable(uk.ac.starlink.util.DataSource datsrc, java.net.URL schemaUrl)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected uk.ac.starlink.table.formats.RowEvaluator.Metadata
obtainMetadata()
Obtains metadata for the table by reading the schema provided at construction time.protected java.util.List<java.lang.String>
readRow(java.io.PushbackInputStream in)
protected uk.ac.starlink.table.formats.RowEvaluator.Metadata
readSchema(java.io.InputStream in)
Given a PostgreSQL/2MASS-type schema file, works out what the column metadata will look like for each column of the table.-
Methods inherited from class uk.ac.starlink.table.formats.StreamStarTable
getColumnCount, getColumnInfo, getInputStream, getRowCount, getRowSequence, init
-
-
-
-
Constructor Detail
-
PostgresAsciiStarTable
public PostgresAsciiStarTable(uk.ac.starlink.util.DataSource datsrc, java.net.URL schemaUrl) throws java.io.IOException
Constructor.- Parameters:
datsrc
- input data sourceschemaUrl
- URL for 'schema' document which describes data types (like twomass_psc_schema)- Throws:
java.io.IOException
-
-
Method Detail
-
readRow
protected java.util.List<java.lang.String> readRow(java.io.PushbackInputStream in) throws uk.ac.starlink.table.TableFormatException, java.io.IOException
- Specified by:
readRow
in classuk.ac.starlink.table.formats.StreamStarTable
- Throws:
uk.ac.starlink.table.TableFormatException
java.io.IOException
-
obtainMetadata
protected uk.ac.starlink.table.formats.RowEvaluator.Metadata obtainMetadata() throws java.io.IOException
Obtains metadata for the table by reading the schema provided at construction time.- Specified by:
obtainMetadata
in classuk.ac.starlink.table.formats.StreamStarTable
- Throws:
java.io.IOException
-
readSchema
protected uk.ac.starlink.table.formats.RowEvaluator.Metadata readSchema(java.io.InputStream in) throws java.io.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:
- metadata object
- Throws:
java.io.IOException
-
-