Package uk.ac.starlink.task
Interface Task
-
public interface Task
Defines a user-level task. Each task has a list of parameters, and an invoke method.- Author:
- Mark Taylor (Starlink)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Executable
createExecutable(Environment env)
Creates an executable object which will do the work of this task in the given Environment.Parameter[]
getParameters()
Returns the list of parameters which may be used by this task.java.lang.String
getPurpose()
Returns a short (one-line) description of the purpose of this task.
-
-
-
Method Detail
-
getParameters
Parameter[] getParameters()
Returns the list of parameters which may be used by this task.- Returns:
- an array of the Parameter objects this task may request values for during its invocation
-
createExecutable
Executable createExecutable(Environment env) throws TaskException
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 toenv
, though this is not absolutely prohibited.- Parameters:
env
- the environment in which the task will operate- Throws:
TaskException
- if no executable can be created; this should usually be aUsageException
or some subclass
-
getPurpose
java.lang.String getPurpose()
Returns a short (one-line) description of the purpose of this task.- Returns:
- plain text description of this task's purpose
-
-