Package uk.ac.starlink.table
Class MetadataStarTable
java.lang.Object
uk.ac.starlink.table.AbstractStarTable
uk.ac.starlink.table.MetadataStarTable
- All Implemented Interfaces:
Closeable,AutoCloseable,StarTable
Utility StarTable implementation which contains only metadata, no data.
Suitable for passing to
TableSink.acceptMetadata(uk.ac.starlink.table.StarTable).- Since:
- 14 Oct 2011
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionMetadataStarTable(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
Modifier and TypeMethodDescriptionintReturns the number of columns in this table.getColumnInfo(int icol) Returns the object describing the data in a given column.Returns an object which can provide random access to this table's data, if random access is implemented.longReturns the number of rows in this table, if known.Returns an object which can iterate over all the rows in the table sequentially.Returns a default splittable which relies on table random access if available, or otherwise provides only sequential access (no splits).Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, close, getCell, getColumnAuxDataInfos, getName, getParameters, getRow, getURL, isRandom, setName, setParameters, setURLMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.ac.starlink.table.StarTable
getParameterByName, setParameter
-
Constructor Details
-
MetadataStarTable
Constructs a metadata table with given column metadata and an indeterminate number of rows.- Parameters:
colInfos- metadata items for each column
-
MetadataStarTable
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 Details
-
getColumnInfo
Description copied from interface:StarTableReturns the object describing the data in a given column.- Specified by:
getColumnInfoin interfaceStarTable- Specified by:
getColumnInfoin 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:StarTableReturns the number of columns in this table.- Specified by:
getColumnCountin interfaceStarTable- Specified by:
getColumnCountin classAbstractStarTable- Returns:
- the number of columns
-
getRowSequence
Description copied from interface:StarTableReturns an object which can iterate over all the rows in the table sequentially. Each such returned object is safe for use within a single thread, but not in general from multiple threads concurrently.- Specified by:
getRowSequencein interfaceStarTable- Specified by:
getRowSequencein classAbstractStarTable- Returns:
- new RowSequence
-
getRowAccess
Description copied from interface:StarTableReturns an object which can provide random access to this table's data, if random access is implemented. Each such returned object is safe for use within a single thread, but not in general from multiple threads concurrently.- Specified by:
getRowAccessin interfaceStarTable- Overrides:
getRowAccessin classAbstractStarTable- Returns:
- new RowAccess
-
getRowSplittable
Description copied from class:AbstractStarTableReturns a default splittable which relies on table random access if available, or otherwise provides only sequential access (no splits).It is often possible to provide a better implementation than this.
- Specified by:
getRowSplittablein interfaceStarTable- Overrides:
getRowSplittablein classAbstractStarTable- Returns:
Tables.getDefaultRowSplittable(this)- See Also:
-
getRowCount
public long getRowCount()Description copied from interface:StarTableReturns 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:
getRowCountin interfaceStarTable- Specified by:
getRowCountin classAbstractStarTable- Returns:
- the number of rows, or -1
-