uk.ac.starlink.ttools.task
Class MultiOutputTask

java.lang.Object
  extended by uk.ac.starlink.ttools.task.MultiOutputTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
TableMultiCopy

public abstract class MultiOutputTask
extends Object
implements Task

Task which writes multiple tables to a single output file. Concrete subclasses must implement the createTableSequence(uk.ac.starlink.task.Environment) method.

Since:
6 Jul 2010
Author:
Mark Taylor

Constructor Summary
protected MultiOutputTask(String purpose)
          Constructor.
 
Method Summary
 Executable createExecutable(Environment env)
          Creates an executable object which will do the work of this task in the given Environment.
protected abstract  TableSequence createTableSequence(Environment env)
          Interrogates the environment to produce a sequence of tables which will be written as the output of this task.
static TableSequence createTableSequence(InputTableSpec[] inSpecs)
          Constructs a table sequence based on an array of input table specifications.
protected  List<Parameter> getParameterList()
          Returns the parameter list for this task; it may be modified.
 Parameter[] getParameters()
          Returns the list of parameters which may be used by this task.
 String getPurpose()
          Returns a short (one-line) description of the purpose of this task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiOutputTask

protected MultiOutputTask(String purpose)
Constructor.

Parameters:
purpose - task purpose
Method Detail

getPurpose

public String getPurpose()
Description copied from interface: Task
Returns a short (one-line) description of the purpose of this task.

Specified by:
getPurpose in interface Task
Returns:
plain text description of this task's purpose

getParameters

public Parameter[] getParameters()
Description copied from interface: Task
Returns the list of parameters which may be used by this task.

Specified by:
getParameters in interface Task
Returns:
an array of the Parameter objects this task may request values for during its invocation

getParameterList

protected List<Parameter> getParameterList()
Returns the parameter list for this task; it may be modified.

Returns:
parameter list

createTableSequence

protected abstract TableSequence createTableSequence(Environment env)
                                              throws TaskException
Interrogates the environment to produce a sequence of tables which will be written as the output of this task.

Parameters:
env - execution environment
Returns:
sequence of tables to write
Throws:
TaskException

createExecutable

public Executable createExecutable(Environment env)
                            throws TaskException
Description copied from interface: Task
Creates an executable object which will do the work of this task in the given Environment. This method should do all of the parameter processing and prepare an object which just executes. The idea is that any communication with the user related to the supplied parameter values can be done before the task starts to execute in earnest. Consequently, the returned Executable object ought not to make any reference to env, though this is not absolutely prohibited.

Specified by:
createExecutable in interface Task
Parameters:
env - the environment in which the task will operate
Throws:
TaskException - if no executable can be created; this should usually be a UsageException or some subclass

createTableSequence

public static TableSequence createTableSequence(InputTableSpec[] inSpecs)
                                         throws TaskException
Constructs a table sequence based on an array of input table specifications.

Parameters:
inSpecs - array of input tables
Throws:
TaskException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.