|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.util.CommandLineArguments
Helper class for parsing command line arguments. It allows for the parsing of attributes, that are preceded by a '-' and the main argument, that is not preceded by an identifier.
Constructor Summary | |
CommandLineArguments()
Creates a new instance of CommandLineArguments |
Method Summary | |
void |
addArgument(String name,
String defaultValue)
tell the parser to treat '-name xxxx' as a key value pair |
void |
addOption(String name)
tell the parser to treat the '-name' option as a boolean option |
String |
getArgument(String name)
returns the string value of the option named 'name' |
String |
getMainArgument()
Getter for property mainArgument. |
Map |
getOptionMap()
Getter for property optionMap. |
boolean |
hasMainArgument()
Returns whether or not the main argument is set. |
void |
initFromArguments(String[] args)
parses the command line arguments and fills the internal map using the given values |
boolean |
isArgumentSet(String name)
whether or not the argument 'name' is available |
boolean |
isOptionSet(String name)
queries the value of the switch named 'name' |
void |
setMainArgument(String mainArgument)
Setter for property mainArgument. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommandLineArguments()
Method Detail |
public void initFromArguments(String[] args)
args
- command line argumentspublic Map getOptionMap()
public void addOption(String name)
name
- the name of the boolean optionpublic String getMainArgument()
public void setMainArgument(String mainArgument)
mainArgument
- New value of property mainArgument.public boolean hasMainArgument()
public void addArgument(String name, String defaultValue)
name
- the keydefaultValue
- the default valuepublic boolean isOptionSet(String name)
name
- the name
public String getArgument(String name)
name
- the name of the option
public boolean isArgumentSet(String name)
name
- the name of the argument
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |