|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ireasoning.util.ParseArguments
public class ParseArguments
This class is used to parse the command line arguments.
Concepts in this class
switches: without value, such as -g in javac
options: with value, such as -d in javac
Example:
ParseArguments p = new ParseArguments(args, "gO", "d"); boolean g = p.isSwitchPresent('g'); String dir = p.getOptionValue('d');
Constructor Summary | |
---|---|
ParseArguments(java.lang.String[] args,
java.lang.String options)
|
|
ParseArguments(java.lang.String[] args,
java.lang.String switches,
java.lang.String options)
|
Method Summary | |
---|---|
java.lang.String[] |
getArguments()
Returns an array of 'real' arguememnts, without switches and options. |
java.lang.String |
getOptionValue(char option)
Returns the value of an option |
java.lang.String |
getOptionValue(char option,
java.lang.String defaultVal)
Returns the value of an option |
boolean |
isSwitchPresent(char switchChar)
Returns true if the passed switch is present |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParseArguments(java.lang.String[] args, java.lang.String switches, java.lang.String options)
switches
- a string of switchesoptions
- a string of optionspublic ParseArguments(java.lang.String[] args, java.lang.String options)
options
- a string of optionsMethod Detail |
---|
public boolean isSwitchPresent(char switchChar)
public java.lang.String getOptionValue(char option)
option
- the optionpublic java.lang.String getOptionValue(char option, java.lang.String defaultVal)
option
- the optiondefaultVal
- the default value of the optionpublic java.lang.String[] getArguments()
|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |