gov.llnl.babel

Class SwitchDictionary

Implemented Interfaces:
CommandLineDictionary

public class SwitchDictionary
extends java.lang.Object
implements CommandLineDictionary

Constructor Summary

SwitchDictionary(boolean multiMode)

Method Summary

void
addCommandLineSwitch(CommandLineSwitch cls)
Add a command line switch to the dictionary of available command line switches.
String[]
executeCommandLineSwitches(String[] arguments)
Execute the command line switches from arguments and return the unprocessed command line arguments.
int
executeMultiple(String[] arguments)
boolean
getHelpPrinted()
Return true iff the help text was printed.
void
printHelpText()

Constructor Details

SwitchDictionary

public SwitchDictionary(boolean multiMode)

Method Details

addCommandLineSwitch

public void addCommandLineSwitch(CommandLineSwitch cls)
            throws NameCollisionException
Add a command line switch to the dictionary of available command line switches. Babel requires that each command line switch have a unique long name. Given that short names are limited, it allocates abbreviated forms on a first come first served basis.
Specified by:
addCommandLineSwitch in interface CommandLineDictionary
Parameters:
cls - a non-null command line switch to add to the dictionary.
Throws:
NameCollisionException - this indicates that cls has the same long name as a CommandLineSwitch already in the dictionary. This exception is never generated due to collisions in the short form.

executeCommandLineSwitches

public String[] executeCommandLineSwitches(String[] arguments)
            throws InvalidOptionException
Execute the command line switches from arguments and return the unprocessed command line arguments.
Parameters:
arguments - the command line arguments to execute.
Returns:
a non-NULL array containing the remaining unprocessed arguments (i.e., those arguments that aren't part of a command line switch).
Throws:
InvalidOptionException - when this exception is thrown, it indicates that the Babel run should be ended. Assume the error has already been reported to java.lang.System.err.

executeMultiple

public int executeMultiple(String[] arguments)

getHelpPrinted

public boolean getHelpPrinted()
Return true iff the help text was printed.

printHelpText

public void printHelpText()