Package uk.ac.starlink.table
Class MetadataStarTable
- java.lang.Object
-
- uk.ac.starlink.table.AbstractStarTable
-
- uk.ac.starlink.table.MetadataStarTable
-
- All Implemented Interfaces:
StarTable
public class MetadataStarTable extends AbstractStarTable
Utility StarTable implementation which contains only metadata, no data. Suitable for passing toTableSink.acceptMetadata(uk.ac.starlink.table.StarTable)
.- Since:
- 14 Oct 2011
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description MetadataStarTable(ColumnInfo[] colInfos)
Constructs a metadata table with given column metadata and an indeterminate number of rows.MetadataStarTable(ColumnInfo[] colInfos, long rowCount)
Constructs a metadata table with given column metadata and a given number of rows.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
Returns the number of columns in this table.ColumnInfo
getColumnInfo(int icol)
Returns the object describing the data in a given column.long
getRowCount()
Returns the number of rows in this table, if known.RowSequence
getRowSequence()
Returns an object which can iterate over all the rows in the table sequentially.-
Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, getCell, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getRow, getURL, isRandom, setName, setParameter, setParameters, setURL
-
-
-
-
Constructor Detail
-
MetadataStarTable
public MetadataStarTable(ColumnInfo[] colInfos)
Constructs a metadata table with given column metadata and an indeterminate number of rows.- Parameters:
colInfos
- metadata items for each column
-
MetadataStarTable
public MetadataStarTable(ColumnInfo[] colInfos, long rowCount)
Constructs a metadata table with given column metadata and a given number of rows.- Parameters:
colInfos
- metadata items for each columnrowCount
- row count, may be -1 to indicate unknown
-
-
Method Detail
-
getColumnInfo
public ColumnInfo getColumnInfo(int icol)
Description copied from interface:StarTable
Returns the object describing the data in a given column.- Specified by:
getColumnInfo
in interfaceStarTable
- Specified by:
getColumnInfo
in classAbstractStarTable
- Parameters:
icol
- the column for which header information is required- Returns:
- a ValueInfo object for column icol
-
getColumnCount
public int getColumnCount()
Description copied from interface:StarTable
Returns the number of columns in this table.- Specified by:
getColumnCount
in interfaceStarTable
- Specified by:
getColumnCount
in classAbstractStarTable
- Returns:
- the number of columns
-
getRowSequence
public RowSequence getRowSequence()
Description copied from interface:StarTable
Returns an object which can iterate over all the rows in the table sequentially.- Specified by:
getRowSequence
in interfaceStarTable
- Specified by:
getRowSequence
in classAbstractStarTable
- Returns:
- an object providing sequential access to the table data
-
getRowCount
public long getRowCount()
Description copied from interface:StarTable
Returns the number of rows in this table, if known. If the number of rows cannot be (easily) determined, a value of -1 will be returned.- Specified by:
getRowCount
in interfaceStarTable
- Specified by:
getRowCount
in classAbstractStarTable
- Returns:
- the number of rows, or -1
-
-