|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCommandLineOptions
Simple command line option parser. This will handle simple switches such as '-b' or longer switches such as '--break=on'.
Constructor Summary | |
CommandLineOptions(java.lang.String[] args)
Create a CommandLineOptions object to represent the options parsed from some argument list. |
Method Summary | |
void |
addOption(java.lang.String swtch,
java.lang.Object key,
java.lang.String description)
Add a single of option for some key. |
void |
addOption(java.lang.String swtch0,
java.lang.String swtch1,
java.lang.Object key,
java.lang.String description)
Add a pair of options for the same key. |
java.lang.String |
get(java.lang.String key)
Get the value for some command line option as a String . |
java.lang.String |
toString()
Return a String describing the options contained within
this map. |
java.lang.String |
usage()
Display usage information for each command line switch. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CommandLineOptions(java.lang.String[] args)
args
- The argument list to parse.Method Detail |
public void addOption(java.lang.String swtch, java.lang.Object key, java.lang.String description)
swtch
- The first switch that sets a value to associate with key
.key
- An object with which switch values will be associated, which should also
be used to retrieve option values with the get()
method.description
- Description of what is controlled by the switch. This
is used for the switch descriptions provided by
usage()
.public void addOption(java.lang.String swtch0, java.lang.String swtch1, java.lang.Object key, java.lang.String description)
swtch0
- The first switch that sets a value to associate with key
.swtch1
- A second switch that sets a value to associate with key
.key
- An object with which switch values will be associated, which should also
be used to retrieve option values with the get()
method.description
- Description of what is controlled by the switch. This
is used for the switch descriptions provided by
usage()
.public java.lang.String get(java.lang.String key)
String
.
key
- A key that may have had some value associated with it.
String
being the supplied commandline value
or null
if the option was not specified.public java.lang.String usage()
public java.lang.String toString()
String
describing the options contained within
this map.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |