Interface DynamicTask

All Known Implementing Classes:
AbstractPlot2Task, CubePlot2Task, GenericPlot2Task, PlanePlot2Task, SkyPlot2Task, SpherePlot2Task, TimePlot2Task, TypedPlot2Task

public interface DynamicTask
Extends the Task interface by methods which allow task parameters to be queried based on a (at least partially) populated Environment. By default, Tasks report the Parameters they use so that the on-line help system can supply that information to users at runtime. However, for some tasks the parameters in use depend on the value of other parameters. This interface allows tasks to make that information available. The method implementations are considered to be on a best-efforts basis, it is not guaranteed that they will be able to report all the parameters. This information is only used for user help.
Since:
19 Sep 2014
Author:
Mark Taylor
  • Method Summary

    Modifier and Type
    Method
    Description
    uk.ac.starlink.task.Parameter<?>[]
    getContextParameters(uk.ac.starlink.task.Environment env)
    Returns the parameters for this task in the context of a given execution environment.
    uk.ac.starlink.task.Parameter<?>
    getParameterByName(uk.ac.starlink.task.Environment env, String paramName)
    Attempts to find a parameter with a given name that might be used by this task in the content of the given environment.
  • Method Details

    • getParameterByName

      uk.ac.starlink.task.Parameter<?> getParameterByName(uk.ac.starlink.task.Environment env, String paramName) throws uk.ac.starlink.task.TaskException
      Attempts to find a parameter with a given name that might be used by this task in the content of the given environment.

      This ought not to result in additional prompts to the user.

      Parameters:
      env - execution environment
      paramName - requested parameter name
      Returns:
      parameter with the given name, or null
      Throws:
      uk.ac.starlink.task.TaskException
    • getContextParameters

      uk.ac.starlink.task.Parameter<?>[] getContextParameters(uk.ac.starlink.task.Environment env) throws uk.ac.starlink.task.TaskException
      Returns the parameters for this task in the context of a given execution environment. If the environment is empty, this should give the same result as Task.getParameters(), but found settings of parameters in the presented environment may lead to parameters being added to or removed from the list.

      This ought not to result in additional prompts to the user.

      Parameters:
      env - execution environment
      Returns:
      list of known parameters
      Throws:
      uk.ac.starlink.task.TaskException