# Class SelectorStarTable

java.lang.Object
uk.ac.starlink.table.WrapperStarTable
uk.ac.starlink.table.SelectorStarTable

All Implemented Interfaces:
  `Closeable, AutoCloseable, StarTable`

public abstract class SelectorStarTable extends WrapperStarTable
Sequential wrapper table which selects only certain rows of its base table. No random access is provided, and the row sequence evaluates the abstract `isIncluded(RowSequence)` method for each row of the base table as it is iterated over.

Since:
  11 Feb 2005
Author:
  Mark Taylor (Starlink)

## Field Summary

### Fields inherited from class WrapperStarTable

`baseTable`

## Constructor Summary

Constructors
Constructor
Description
`SelectorStarTable(StarTable baseTable)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Object`
`getCell(int icol)`
`Object[]`
`getRow()`
`RowAccess`
`getRowAccess()`
Returns an object which can provide random access to this table's data, if random access is implemented.
`long`
`getRowCount()`
Returns -1 (length unknown).
`RowSequence`
`getRowSequence()`
Returns an object which can iterate over all the rows in the table sequentially.
`RowSplittable`
`getRowSplittable()`
Returns an object which can iterate over all the rows in the table, but which may also be requested to split recursively for potentially parallel processing.
`abstract boolean`
`isIncluded(RowSequence baseSeq)`
Evaluated to determine whether rows of the base table are included in this one.
`boolean`
`isRandom()`
Returns false.

### Methods inherited from class WrapperStarTable

`checkedLongToInt, close, getBaseTable, getCell, getColumnAuxDataInfos, getColumnCount, getColumnInfo, getName, getParameterByName, getParameters, getRow, getURL, setName, setParameter, setURL, toString`

### Methods inherited from class Object

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

## Constructor Details

### SelectorStarTable

public SelectorStarTable(StarTable baseTable)
Constructor.

Parameters:
  `baseTable` - table on which this is based

## Method Details

### isIncluded

public abstract boolean isIncluded(RowSequence baseSeq) throws IOException
Evaluated to determine whether rows of the base table are included in this one.

Parameters:
  `baseSeq` - row sequence of the base table
Returns:
  true iff the current row of `baseSeq` is to be included
Throws:
  `IOException`

### isRandom

public boolean isRandom()
Returns false.

Specified by:
  `isRandom` in interface `StarTable`
Overrides:
  `isRandom` in class `WrapperStarTable`
Returns:
  `true` if table random access methods are available

### getRowCount

public long getRowCount()
Returns -1 (length unknown).

Specified by:
  `getRowCount` in interface `StarTable`
Overrides:
  `getRowCount` in class `WrapperStarTable`
Returns:
  the number of rows, or -1

### getRow

public Object[] getRow()

### getCell

public Object getCell(int icol)

### getRowSequence

public RowSequence getRowSequence() throws IOException
Description copied from interface: `StarTable`
Returns 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:
  `getRowSequence` in interface `StarTable`
Overrides:
  `getRowSequence` in class `WrapperStarTable`
Returns:
  new RowSequence
Throws:
  `IOException` - if there is an error providing access

### getRowSplittable

public RowSplittable getRowSplittable() throws IOException
Description copied from interface: `StarTable`
Returns an object which can iterate over all the rows in the table, but which may also be requested to split recursively for potentially parallel processing.

The return value must be non-null, and may provide splitting arrangements specially appropriate for the implementation. If this table 'wraps' an upstream table, it is usually best to base the implementation on calls to the the upstream `getRowSplittable` method, so that upstream policy about how to divide up the table is respected. However, implementations without special requirements may return `Tables.getDefaultRowSplittable``(this)`.

Specified by:
  `getRowSplittable` in interface `StarTable`
Overrides:
  `getRowSplittable` in class `WrapperStarTable`
Returns:
  new RowSplittable
Throws:
  `IOException`
See Also:
  - `RowRunner`

### getRowAccess

public RowAccess getRowAccess()
Description copied from interface: `StarTable`
Returns 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:
  `getRowAccess` in interface `StarTable`
Overrides:
  `getRowAccess` in class `WrapperStarTable`
Returns:
  new RowAccess