Package uk.ac.starlink.table
Class ConstantStarTable
- java.lang.Object
-
- uk.ac.starlink.table.AbstractStarTable
-
- uk.ac.starlink.table.RandomStarTable
-
- uk.ac.starlink.table.ConstantStarTable
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,StarTable
public class ConstantStarTable extends RandomStarTable
Table implementation representing a table in which every row is the same as every other.- Since:
- 3 Jul 2006
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description ConstantStarTable(ColumnInfo[] infos, java.lang.Object[] cells, long nrow)
Constructs a new constant star table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getCell(long lrow, int icol)
Implementations of this method must be safe for concurrent calls from multiple threads.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()
Implementations must supply a non-negative return value.boolean
isRandom()
Returns true.-
Methods inherited from class uk.ac.starlink.table.RandomStarTable
getRowAccess, getRowSequence
-
Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, close, getColumnAuxDataInfos, getName, getParameters, getRow, getRowSplittable, getURL, setName, setParameters, setURL
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.ac.starlink.table.StarTable
getParameterByName, setParameter
-
-
-
-
Constructor Detail
-
ConstantStarTable
public ConstantStarTable(ColumnInfo[] infos, java.lang.Object[] cells, long nrow)
Constructs a new constant star table.- Parameters:
infos
- array of column metadata objects (one for each column)cells
- row data - the same for every rownrow
- number of rows in this table
-
-
Method Detail
-
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
-
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
-
getRowCount
public long getRowCount()
Description copied from class:RandomStarTable
Implementations must supply a non-negative return value.- Specified by:
getRowCount
in interfaceStarTable
- Specified by:
getRowCount
in classRandomStarTable
- Returns:
- the number of rows in the table
-
isRandom
public boolean isRandom()
Description copied from class:RandomStarTable
Returns true.- Specified by:
isRandom
in interfaceStarTable
- Overrides:
isRandom
in classRandomStarTable
- Returns:
- true
-
getCell
public java.lang.Object getCell(long lrow, int icol)
Description copied from class:RandomStarTable
Implementations of this method must be safe for concurrent calls from multiple threads.- Specified by:
getCell
in interfaceStarTable
- Specified by:
getCell
in classRandomStarTable
- Parameters:
lrow
- the index of the cell's rowicol
- the index of the cell's column- Returns:
- the contents of this cell
-
-