uk.ac.starlink.ttools
Class ProcessingMode

java.lang.Object
  |
  +--uk.ac.starlink.ttools.ProcessingMode
Direct Known Subclasses:
CopyMode, CountMode, JdbcMode, MetadataMode, StatsMode

public abstract class ProcessingMode
extends Object

Interface defining the final element of a table processing pipeline - the one which disposes of the table in some way.

Since:
11 Feb 2005

Constructor Summary
ProcessingMode()
           
 
Method Summary
 String getModeUsage()
          Returns a list of additional flags which can be used when this mode is operational (as processed by setArgs).
abstract  String getName()
          Returns the name of this mode.
 PrintStream getOutputStream()
          Returns the output stream to which processing modes should write user-directed (human-readable) output.
abstract  void process(StarTable table)
          Perform disposal of the table.
 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

ProcessingMode

public ProcessingMode()
Method Detail

getName

public abstract String getName()
Returns the name of this mode. The returned value should be short and preferably lower case - it will be used (with a prepended "-") as the name of a command line flag.

Returns:
mode name

process

public abstract void process(StarTable table)
                      throws IOException
Perform disposal of the table.

Parameters:
table - input table to do something with
IOException

setArgs

public boolean setArgs(List argList)
Consume a list of arguments. Any arguments which this mode 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

getModeUsage

public String getModeUsage()
Returns a list of additional flags which can be used when this mode is operational (as processed by setArgs). The default implementation returns null.

Returns:
usage string describing mode-specific flags

getOutputStream

public PrintStream getOutputStream()
Returns the output stream to which processing modes should write user-directed (human-readable) output.

Returns:
standard output stream

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