uk.ac.starlink.task
Class MultiTaskInvoker

java.lang.Object
  extended by 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
MultiTaskInvoker(String toolName, ObjectFactory<Task> taskFactory)
          Constructor.
 
Method Summary
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiTaskInvoker

public MultiTaskInvoker(String toolName,
                        ObjectFactory<Task> taskFactory)
Constructor.

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

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


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