getopt-0.3

jrowe.getopt
Interface GetOptions

All Known Implementing Classes:
DefaultGetOptions

public interface GetOptions

An object that stores a list of Option objects and then parse command line arguments using them.

Version:
1.3 03 MAY 2000 Added more constants
Author:
Joshua T. Rowe

Field Summary
static int OPTION_SETUP_DOS
          Indicates the for overal setup of the options.
static int OPTION_SETUP_GNU
          Indicates the for overal setup of the options.
static int OPTION_SETUP_POSIX
          Indicates the for overal setup of the options.
 
Method Summary
 void add(Option option)
          Adds an Option to the list of parseable options.
 Option get(String optionName)
          Returns an Option from the list of parseable options.
 List getProgramArgs()
          Returns the program arguments.
 Iterator iterator()
          Returns an Iterator object which will iterate over all of the Options contained by this object.
 void remove(Option option)
          Removes an Option from the list of parseable options.
 Option remove(String optionName)
          Removes an Option from the list of parseable options.
 void setArgs(String[] args)
          Sets the arguments from the command line.
 

Field Detail

OPTION_SETUP_GNU

public static final int OPTION_SETUP_GNU
Indicates the for overal setup of the options.
Since:
1.3

OPTION_SETUP_POSIX

public static final int OPTION_SETUP_POSIX
Indicates the for overal setup of the options.
Since:
1.3

OPTION_SETUP_DOS

public static final int OPTION_SETUP_DOS
Indicates the for overal setup of the options.
Since:
1.3
Method Detail

add

public void add(Option option)
Adds an Option to the list of parseable options.
Parameters:
option - The Option to add.

remove

public void remove(Option option)
Removes an Option from the list of parseable options.
Parameters:
option - The Option to remove.

remove

public Option remove(String optionName)
Removes an Option from the list of parseable options.
Parameters:
optionName - The name of the Option to remove.
The - Option which was removed. If this object does not contain an Option by that name, then null will be returned.

get

public Option get(String optionName)
Returns an Option from the list of parseable options.
Parameters:
optionName - The name of the Option to return.
The - Option. If this object does not contain an Option by that name, then null will be returned.

iterator

public Iterator iterator()
Returns an Iterator object which will iterate over all of the Options contained by this object.
Returns:
An Iterator

setArgs

public void setArgs(String[] args)
             throws OptionException
Sets the arguments from the command line.

The options are processed immediately.

Parameters:
args - The arguments from the command line.

getProgramArgs

public List getProgramArgs()
Returns the program arguments.
Returns:
The program arguments.

getopt-0.3