private static class Test.Arguments
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
args
the array containing the arguments
|
private int |
pos
the reading position
|
Constructor and Description |
---|
Arguments(java.lang.String[] theArgs)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
advance()
advance the position to the next argument, unless there are no more
|
java.lang.String |
getArg()
return the current argument
|
boolean |
hasMore()
return whether more arguments are available
|
boolean |
isOption()
return whether an argument exists and this is an option (i.e.
|
boolean |
isValue()
return whether an argument exists and is not a value (i.e. not
starting with a hyphen)
|
java.lang.String |
nextArg()
return the current argument, moving the internal position to the next
argument.
|
java.lang.String |
nextValue()
return the next value and moving the internal position to the next
argument.
|
private java.lang.String[] args
private int pos
public Arguments(java.lang.String[] theArgs)
theArgs
- the argumentspublic boolean hasMore()
true
if sopublic boolean isOption()
true
if sopublic boolean isValue()
true
if sopublic java.lang.String getArg()
null
if there
are no more argumentspublic java.lang.String nextArg()
null
if the
end of the arguments have been reachedpublic java.lang.String nextValue()
null
is
returned and the position is left unchangednull
if no more
values are available or if the current argument
is not a valuepublic void advance()
Copyright © 2005-2013 Knipp Medien und Kommunikation GmbH