# Class MultiServiceColumnCalculator<S>

java.lang.Object
uk.ac.starlink.ttools.calc.MultiServiceColumnCalculator<S>

All Implemented Interfaces:
  `ColumnCalculator<S>`

Direct Known Subclasses:
  `SchlegelCalculator`

public abstract class MultiServiceColumnCalculator<S> extends Object implements ColumnCalculator<S>
ColumnCalculator implementation which works by invoking a service for each row. In this case the calculation can be done row by row, but if the service is slow use of the ColumnCalculator interface can allow multiplexing for performance.

Since:
  14 Oct 2011
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`MultiServiceColumnCalculator()`

## Method Summary

Modifier and Type
Method
Description
`void`
`calculateColumns(S spec, uk.ac.starlink.table.StarTable tupleTable, uk.ac.starlink.table.TableSink sink)`
Performs the calculation.
`abstract ServiceOperation`
`createServiceOperation(S spec)`
Defines the service operation to be invoked for each row.

### Methods inherited from class Object

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

### Methods inherited from interface ColumnCalculator

`getTupleInfos`

## Constructor Details

### MultiServiceColumnCalculator

public MultiServiceColumnCalculator()

## Method Details

### createServiceOperation

public abstract ServiceOperation createServiceOperation(S spec)
Defines the service operation to be invoked for each row.

Parameters:
  `spec` - specification object for the calculation

### calculateColumns

public void calculateColumns(S spec, uk.ac.starlink.table.StarTable tupleTable, uk.ac.starlink.table.TableSink sink) throws IOException
Description copied from interface: `ColumnCalculator`
Performs the calculation. Rows are written to the output sink based on the input table and configuration contained in the `spec` object. The output table must have the same number of rows as the input table, and will not normally contain any of the same columns.

Specified by:
  `calculateColumns` in interface `ColumnCalculator<S>`
Parameters:
  `spec` - specification object providing additional instructions about the calculation to be performed
  `tupleTable` - input table, with one column for each tuple element
  `sink` - sink to which the output table is written
Throws:
  `IOException`