# Class MultiTaskInvoker

java.lang.Object
uk.ac.starlink.task.MultiTaskInvoker

public class MultiTaskInvoker extends Object
Invokes tasks from a command line when the tasks are available from an `ObjectFactory`.

Since:
  23 Jan 2007
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`MultiTaskInvoker(String toolName, uk.ac.starlink.util.ObjectFactory<Task> taskFactory)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getVersionMessage()`
Returns the message to be reported if the "-version" flag is given.
`int`
`invoke(String[] args)`
Invokes one of the tasks known by this invoker given a command line.
`void`
`setVersionMessage(String msg)`
Sets the message which will be reported if the "-version" flag is given.

### Methods inherited from class Object

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

## Constructor Details

### MultiTaskInvoker

public MultiTaskInvoker(String toolName, uk.ac.starlink.util.ObjectFactory<Task> taskFactory)
Constructor.

Parameters:
  `toolName` - user-known name for the tool
  `taskFactory` - lists available tasks

## Method Details

### invoke

public int invoke(String[] args)
Invokes one of the tasks known by this invoker given a command line. The commmand line is an array of words of the form

       [<flags>] <taskname> [<task-args>]

Parameters:
  `args` - command line words

### setVersionMessage

public void setVersionMessage(String msg)
Sets the message which will be reported if the "-version" flag is given.

Parameters:
  `msg` - formatted version message

### getVersionMessage

public String getVersionMessage()
Returns the message to be reported if the "-version" flag is given.

Returns:
  formatted version message