uk.ac.starlink.ttools
Class TableTask

java.lang.Object
  |
  +--uk.ac.starlink.ttools.TableTask
Direct Known Subclasses:
TablePipe

public abstract class TableTask
extends Object

Generic superclass for table processing utilities.

Since:
11 Feb 2005

Constructor Summary
TableTask()
           
 
Method Summary
abstract  void execute()
          Performs the work of this task;
abstract  String getCommandName()
          Returns the name by which this task would like to be known.
 String[] getGenericOptions()
          Returns a list of generic options understood by this class.
 String getHelp()
          Returns a help message.
abstract  String[] getSpecificOptions()
          Returns a list of options specfic to this TableTask subclass.
 StarTableFactory getTableFactory()
          Returns a table factory.
 String getUsage()
          Returns a usage message.
 boolean isNoAction()
           
 boolean isVerbose()
           
 boolean run(String[] args)
          Runs this task.
 boolean setArgs(List argList)
          Consume a list of arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableTask

public TableTask()
Method Detail

getCommandName

public abstract String getCommandName()
Returns the name by which this task would like to be known.


run

public boolean run(String[] args)
Runs this task.

Parameters:
args - command line arguments
Returns:
true iff the task has executed successfully

setArgs

public boolean setArgs(List argList)
Consume a list of arguments. Any arguments which this task knows about should be noted and removed from the list. Any others should be ignored, and left in the list. The return value should be true if everything looks OK, false if there is some syntax error in the arguments.

Parameters:
argList - an array of strings obtained from the command line
Returns:
true iff the arguments are unobjectionable

isVerbose

public boolean isVerbose()

isNoAction

public boolean isNoAction()

execute

public abstract void execute()
                      throws IOException
Performs the work of this task;

IOException

getTableFactory

public StarTableFactory getTableFactory()
Returns a table factory.

Returns:
factory

getHelp

public String getHelp()
Returns a help message. May be more verbose than usage message.

Returns:
help string

getUsage

public String getUsage()
Returns a usage message. This is composed of both getGenericOptions() and getSpecificOptions().

Returns:
usage string

getGenericOptions

public String[] getGenericOptions()
Returns a list of generic options understood by this class.

Returns:
generic options (one string per word)

getSpecificOptions

public abstract String[] getSpecificOptions()
Returns a list of options specfic to this TableTask subclass.

Returns:
specific options (one string per word)

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.