uk.ac.starlink.gbin
Class GbinStarTable

java.lang.Object
  extended by uk.ac.starlink.table.AbstractStarTable
      extended by uk.ac.starlink.gbin.GbinStarTable
All Implemented Interfaces:
StarTable

public abstract class GbinStarTable
extends AbstractStarTable

Partial StarTable implementation for use with GBIN files.

Since:
6 Jun 2017

Constructor Summary
protected GbinStarTable(GbinTableProfile profile, java.lang.Class<?> gobjClazz)
          Constructor.
 
Method Summary
static
<T> GbinStarTable
createCollectionTable(GbinTableProfile profile, java.lang.Class<T> gobjClazz, java.util.Collection<? extends T> gobjList)
          Returns a table instance based on a collection of gaia objects.
 RowSequence createRowSequence(GbinObjectReader reader, java.lang.Object gobj0)
          Returns a row sequence for this table based on some required objects.
 int getColumnCount()
          Returns the number of columns in this table.
 ColumnInfo getColumnInfo(int icol)
          Returns the object describing the data in a given column.
 java.lang.Class<?> getGaiaObjectClass()
          Returns the class of the elements contained in the GBIN file.
 
Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, getCell, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getRow, getRowCount, getRowSequence, getURL, isRandom, setName, setParameter, setParameters, setURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GbinStarTable

protected GbinStarTable(GbinTableProfile profile,
                        java.lang.Class<?> gobjClazz)
Constructor.

Parameters:
profile - configures how GBIN files will be mapped to a table
gobjClazz - class of all objects in GBIN file
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

createRowSequence

public RowSequence createRowSequence(GbinObjectReader reader,
                                     java.lang.Object gobj0)
Returns a row sequence for this table based on some required objects.

Parameters:
reader - gbin object reader positioned after the first object in the stream; must read objects suitable for this table
gobj0 - first object read from reader
Returns:
new row sequence for this table

getGaiaObjectClass

public java.lang.Class<?> getGaiaObjectClass()
Returns the class of the elements contained in the GBIN file.

Returns:
element class

createCollectionTable

public static <T> GbinStarTable createCollectionTable(GbinTableProfile profile,
                                                      java.lang.Class<T> gobjClazz,
                                                      java.util.Collection<? extends T> gobjList)
Returns a table instance based on a collection of gaia objects. The returned table is not random access.

A random-access implementation is possible, but trying to implement getCell efficiently would be a bit fiddly because of the way that column values are extracted.

Parameters:
profile - configures how Gaia objects will be mapped to columns
gobjClazz - class of all objects representing rows
gobjList - collection of typed objects, one for each table row
Returns:
sequential-access table based on array of gaia objects