Class MultiServiceColumnCalculator<S>

  • All Implemented Interfaces:
    ColumnCalculator<S>
    Direct Known Subclasses:
    SchlegelCalculator

    public abstract class MultiServiceColumnCalculator<S>
    extends java.lang.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 Detail

      • MultiServiceColumnCalculator

        public MultiServiceColumnCalculator()
    • Method Detail

      • 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 java.io.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:
        java.io.IOException