uk.ac.starlink.table
Class ConstantStarTable

java.lang.Object
  extended by uk.ac.starlink.table.AbstractStarTable
      extended by uk.ac.starlink.table.RandomStarTable
          extended by uk.ac.starlink.table.ConstantStarTable
All Implemented Interfaces:
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

Constructor Summary
ConstantStarTable(ColumnInfo[] infos, java.lang.Object[] cells, long nrow)
          Constructs a new constant star table.
 
Method Summary
 java.lang.Object getCell(long lrow, int icol)
          The AbstractStarTable implementation of this method throws an UnsupportedOperationException, since unless otherwise provided there is no random access.
 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()
          The number of rows in this table.
 boolean isRandom()
          Returns true.
 
Methods inherited from class uk.ac.starlink.table.RandomStarTable
getRowSequence
 
Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getRow, getURL, setName, setParameter, setParameters, setURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 row
nrow - 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 interface StarTable
Specified by:
getColumnCount in class AbstractStarTable
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 interface StarTable
Specified by:
getColumnInfo in class AbstractStarTable
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
The number of rows in this table. Implementations must supply a non-negative return value.

Specified by:
getRowCount in interface StarTable
Specified by:
getRowCount in class RandomStarTable
Returns:
the number of rows in the table

isRandom

public boolean isRandom()
Description copied from class: RandomStarTable
Returns true.

Specified by:
isRandom in interface StarTable
Overrides:
isRandom in class RandomStarTable
Returns:
true

getCell

public java.lang.Object getCell(long lrow,
                                int icol)
Description copied from class: AbstractStarTable
The AbstractStarTable implementation of this method throws an UnsupportedOperationException, since unless otherwise provided there is no random access.

Specified by:
getCell in interface StarTable
Overrides:
getCell in class AbstractStarTable
Parameters:
lrow - the index of the cell's row
icol - the index of the cell's column
Returns:
the contents of this cell

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.