private class CmdLineParser.CmdLineImpl extends java.lang.Object implements Parameters
String
array.
Can move forward; can look ahead.Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
args |
private int |
pos |
Constructor and Description |
---|
CmdLineImpl(java.lang.String[] args) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getCurrentToken() |
java.lang.String |
getParameter(int idx)
Gets the additional parameter to this option.
|
protected boolean |
hasMore() |
private void |
proceed(int n) |
int |
size()
Number of remaining tokens.
|
(package private) void |
splitToken()
Used when the current token is of the form "-option=value",
to replace the current token by "value", as if this was given as two tokens "-option value"
|
protected boolean hasMore()
protected java.lang.String getCurrentToken()
private void proceed(int n)
public java.lang.String getParameter(int idx) throws CmdLineException
Parameters
getParameter
in interface Parameters
idx
- specifying 0 will retrieve the token next to the option.
For example, if the command line looks like -o abc -d x
,
then getParameter(0)
for -o
returns abc
and getParameter(1)
will return -d
.null
valid String
. If an attempt is
made to access a non-existent index, this method throws
appropriate CmdLineException
.CmdLineException
public int size()
Parameters
size
in interface Parameters
void splitToken()