Package 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:
java.io.Closeable,java.lang.AutoCloseable,uk.ac.starlink.table.StarTable
public class AllWiseAsciiStarTable extends uk.ac.starlink.table.formats.StreamStarTableStarTable 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
-
-
Constructor Summary
Constructors Constructor Description AllWiseAsciiStarTable(uk.ac.starlink.util.DataSource datsrc, java.net.URL schemaUrl, long nrow)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected uk.ac.starlink.table.formats.RowEvaluator.MetadataobtainMetadata()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.MetadatareadSchema(uk.ac.starlink.util.DataSource datsrc)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
-
Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, close, getCell, getColumnAuxDataInfos, getName, getParameters, getRow, getRowAccess, getRowSplittable, getURL, isRandom, setName, setParameters, setURL
-
-
-
-
Constructor Detail
-
AllWiseAsciiStarTable
public AllWiseAsciiStarTable(uk.ac.starlink.util.DataSource datsrc, java.net.URL schemaUrl, long nrow) throws java.io.IOExceptionConstructor. 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:
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:
readRowin classuk.ac.starlink.table.formats.StreamStarTable- Throws:
uk.ac.starlink.table.TableFormatExceptionjava.io.IOException
-
obtainMetadata
protected uk.ac.starlink.table.formats.RowEvaluator.Metadata obtainMetadata() throws java.io.IOExceptionObtains metadata for the table by reading the schema provided at construction time.- Specified by:
obtainMetadatain classuk.ac.starlink.table.formats.StreamStarTable- Throws:
java.io.IOException
-
readSchema
protected uk.ac.starlink.table.formats.RowEvaluator.Metadata readSchema(uk.ac.starlink.util.DataSource datsrc) throws java.io.IOExceptionGiven 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:
java.io.IOException
-
-