public class ArgParser extends Object
The agruments can be switches (boolean), or Strings. For string
arguements, either of the following 2 formats is valid:
-cargVal or
-c argVal
For either of these 2 cases, a call go getStringArg("-c") will return argVal.
| Constructor and Description |
|---|
ArgParser(String[] a)
The constructor requires the arguements that are passed to the
main method.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBooleanArg(String key)
Returns a boolean indicating whether a command like switch was
present.
|
boolean |
getBooleanArg(String key,
boolean def)
Returns a boolean indicating whether a command like switch was
present.
|
int |
getIntArg(String key,
int def) |
Integer |
getIntegerArg(String key) |
String |
getLastArg() |
String |
getStringArg(String key) |
String |
getStringArg(String key,
String def)
Returns the string corresponding to the requested key.
|
int |
size() |
String |
toString() |
public ArgParser(String[] a)
public String getStringArg(String key, String def)
public int size()
public String getLastArg()
public int getIntArg(String key, int def)
public boolean getBooleanArg(String key)
public boolean getBooleanArg(String key, boolean def)
Copyright © 2014. All rights reserved.