# Class CdfStarTable

java.lang.Object
uk.ac.starlink.table.AbstractStarTable
uk.ac.starlink.cdf.CdfStarTable

All Implemented Interfaces:
  `Closeable, AutoCloseable, uk.ac.starlink.table.StarTable`

public class CdfStarTable extends uk.ac.starlink.table.AbstractStarTable
StarTable implementation for CDF files.

Since:
  24 Jun 2013
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`CdfStarTable(uk.ac.bristol.star.cdf.CdfContent content, CdfTableProfile profile, uk.ac.bristol.star.cdf.Variable dependVar)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Object`
`getCell(long irow, int icol)`
`int`
`getColumnCount()`
`uk.ac.starlink.table.ColumnInfo`
`getColumnInfo(int icol)`
`uk.ac.starlink.table.RowAccess`
`getRowAccess()`
`long`
`getRowCount()`
`uk.ac.starlink.table.RowSequence`
`getRowSequence()`
`static String`
`getStringEntry(uk.ac.bristol.star.cdf.VariableAttribute att, uk.ac.bristol.star.cdf.Variable var)`
Gets a variable's attribute value expected to be of string type.
`boolean`
`isRandom()`

### Methods inherited from class uk.ac.starlink.table.AbstractStarTable

`checkedLongToInt, close, getColumnAuxDataInfos, getName, getParameters, getRow, getRowSplittable, getURL, setName, setParameters, setURL`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface uk.ac.starlink.table.StarTable

`getParameterByName, setParameter`

## Constructor Details

### CdfStarTable

public CdfStarTable(uk.ac.bristol.star.cdf.CdfContent content, CdfTableProfile profile, uk.ac.bristol.star.cdf.Variable dependVar) throws IOException
Constructor.

The optional `dependVar` parameter provides an effective grouping of columns, and corresponds to the DEPEND_0 variable attribute defined by the ISTP Metadata Guidelines. CDF files contain multiple variables that are not necessarily all columns of the same table; at least within the ISTP guidelines a table is effectively defined by an independent epoch variable and a number of other variables depending on that (and thus presumably having the same number of values/rows). This interpretation is not exactly explicit in ISTP, but it looks like our best bet for turning CDF content into a thing or things that look like StarTables. If `dependVar` is null, we just have to assume that all the variables are effectively columns in the same table. In case that they don't all have the same multiplicity, just guess something and issue a warning.

Parameters:
  `content` - CDF data content object
  `profile` - parameterisation of how CDFs should get turned into StarTables
  `dependVar` - independent variable on which other columns depend, or null
Throws:
  `IOException` - in case of error

## Method Details

### getColumnCount

public int getColumnCount()

Specified by:
  `getColumnCount` in interface `uk.ac.starlink.table.StarTable`
Specified by:
  `getColumnCount` in class `uk.ac.starlink.table.AbstractStarTable`

### getRowCount

public long getRowCount()

Specified by:
  `getRowCount` in interface `uk.ac.starlink.table.StarTable`
Specified by:
  `getRowCount` in class `uk.ac.starlink.table.AbstractStarTable`

### getColumnInfo

public uk.ac.starlink.table.ColumnInfo getColumnInfo(int icol)

Specified by:
  `getColumnInfo` in interface `uk.ac.starlink.table.StarTable`
Specified by:
  `getColumnInfo` in class `uk.ac.starlink.table.AbstractStarTable`

### isRandom

public boolean isRandom()

Specified by:
  `isRandom` in interface `uk.ac.starlink.table.StarTable`
Overrides:
  `isRandom` in class `uk.ac.starlink.table.AbstractStarTable`

### getCell

public Object getCell(long irow, int icol) throws IOException

Specified by:
  `getCell` in interface `uk.ac.starlink.table.StarTable`
Overrides:
  `getCell` in class `uk.ac.starlink.table.AbstractStarTable`
Throws:
  `IOException`

### getRowSequence

public uk.ac.starlink.table.RowSequence getRowSequence() throws IOException

Specified by:
  `getRowSequence` in interface `uk.ac.starlink.table.StarTable`
Specified by:
  `getRowSequence` in class `uk.ac.starlink.table.AbstractStarTable`
Throws:
  `IOException`

### getRowAccess

public uk.ac.starlink.table.RowAccess getRowAccess() throws IOException

Specified by:
  `getRowAccess` in interface `uk.ac.starlink.table.StarTable`
Overrides:
  `getRowAccess` in class `uk.ac.starlink.table.AbstractStarTable`
Throws:
  `IOException`

### getStringEntry

public static String getStringEntry(uk.ac.bristol.star.cdf.VariableAttribute att, uk.ac.bristol.star.cdf.Variable var)
Gets a variable's attribute value expected to be of string type.

Parameters:
  `att` - attribute
  `var` - variable
Returns:
  string value of att for var, or null if it doesn't exist or has the wrong type