gov.llnl.babel
Class UserOptions.ShortFileNamesSwitch

java.lang.Object
  extended bygov.llnl.babel.UserOptions.BasicSwitch
      extended bygov.llnl.babel.UserOptions.ShortFileNamesSwitch
All Implemented Interfaces:
CommandLineSwitch
Enclosing class:
UserOptions

public class UserOptions.ShortFileNamesSwitch
extends gov.llnl.babel.UserOptions.BasicSwitch


Constructor Summary
UserOptions.ShortFileNamesSwitch()
           
 
Method Summary
 java.lang.String getArgumentName()
          If the switch has an argument, what name should be used to identify it in the help text.
 java.lang.String getHelpText()
          Return a brief string describing what this command line switch implies or does.
 java.lang.String getLongName()
          Return the long option name, usually one or more words separated by hyphens.
 int getShortForm()
          If the command line switch has a one character short form, return the character value as an integer.
 boolean hasOptionalArgument()
          Return true if and only if, this command line switch has an optional argument.
 boolean hasRequiredArgument()
          Return true if and only if, this command line switch requires an argument.
 void processCommandSwitch(java.lang.String optarg)
          This method is called when the Babel end user specifies this command line switch on the command line.
 void setShortForm(int v)
          If the command line manager cannot support the short form you requested or if you did not specify the short form, this method will be called to set your short form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserOptions.ShortFileNamesSwitch

public UserOptions.ShortFileNamesSwitch()
Method Detail

processCommandSwitch

public final void processCommandSwitch(java.lang.String optarg)
Description copied from interface: CommandLineSwitch
This method is called when the Babel end user specifies this command line switch on the command line.

Parameters:
optarg - this argument will be null if the command line switch doesn't take a required argument (i.e., CommandLineSwitch.hasRequiredArgument() is false) or if the command line switch takes an optional argument (i.e., CommandLineSwitch.hasOptionalArgument() is true) and an argument wasn't provided; otherwise, the argument is a non-null string including the text from the command line.

getLongName

public final java.lang.String getLongName()
Description copied from interface: CommandLineSwitch
Return the long option name, usually one or more words separated by hyphens. On the command line, users will invoke this option by putting this string after two consecutive hyphen. For example, if this method returned "foo-mode", users would invoke it by putting "--foo-mode" on the command line. Try to avoid long names that are likely to be used by other extensions.

Specified by:
getLongName in interface CommandLineSwitch
Returns:
a non-null string containing one or more words separated by hyphens. The string should not contain any white space characters.

getShortForm

public final int getShortForm()
Description copied from interface: CommandLineSwitch
If the command line switch has a one character short form, return the character value as an integer. Since there are fewer options for the short form, do not count on it being available. If you do not care to define a short form, return 0.

Specified by:
getShortForm in interface CommandLineSwitch
Returns:
0 if you do not care to define a short form; otherwise, return the short form character as an int. This value should be strictly less than 65536. The return value should generally be a letter, a digit, or punctuation character -- excluding 'W', '-', ':', and '?'.

setShortForm

public final void setShortForm(int v)
Description copied from interface: CommandLineSwitch
If the command line manager cannot support the short form you requested or if you did not specify the short form, this method will be called to set your short form. You must store the value provided by this call and return it when CommandLineSwitch.getShortForm() is called in the future.

Specified by:
setShortForm in interface CommandLineSwitch
Parameters:
v - your object must return this value in future calls to CommandLineSwitch.getShortForm().

getHelpText

public final java.lang.String getHelpText()
Description copied from interface: CommandLineSwitch
Return a brief string describing what this command line switch implies or does. This text is presented when the user executes the help command line option. Do not mention the short form, if it's available, the automatically generated text will mention it.

Specified by:
getHelpText in interface CommandLineSwitch
Returns:
a non-null string with no newline characters.

getArgumentName

public java.lang.String getArgumentName()
Description copied from interface: CommandLineSwitch
If the switch has an argument, what name should be used to identify it in the help text. You may refer to this name in getHelpText.

Specified by:
getArgumentName in interface CommandLineSwitch
Returns:
null or the name of the optional or required argument.

hasRequiredArgument

public boolean hasRequiredArgument()
Description copied from interface: CommandLineSwitch
Return true if and only if, this command line switch requires an argument. If this method returns true, hasOptionalArgument should return false.

Specified by:
hasRequiredArgument in interface CommandLineSwitch
Returns:
true implies that the switch take an optional argument; false implies that it does not.

hasOptionalArgument

public boolean hasOptionalArgument()
Description copied from interface: CommandLineSwitch
Return true if and only if, this command line switch has an optional argument. If this method returns true, hasRequiredArgument should return false.

Specified by:
hasOptionalArgument in interface CommandLineSwitch
Returns:
true implies that the switch takes an optional argument; false implies that it does not.