Class CmdLineParser.CmdLineImpl
java.lang.Object
org.kohsuke.args4j.CmdLineParser.CmdLineImpl
- All Implemented Interfaces:
Parameters
- Enclosing class:
CmdLineParser
Essentially a pointer over a
String array.
Can move forward; can look ahead.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetParameter(int idx) Gets the additional parameter to this option.protected booleanhasMore()private voidproceed(int n) intsize()Number of remaining tokens.(package private) voidUsed 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"
-
Field Details
-
args
-
pos
private int pos
-
-
Constructor Details
-
CmdLineImpl
CmdLineImpl(String[] args)
-
-
Method Details
-
hasMore
protected boolean hasMore() -
getCurrentToken
-
proceed
private void proceed(int n) -
getParameter
Description copied from interface:ParametersGets the additional parameter to this option.- Specified by:
getParameterin interfaceParameters- Parameters:
idx- specifying 0 will retrieve the token next to the option. For example, if the command line looks like-o abc -d x, thengetParameter(0)for-oreturnsabcandgetParameter(1)will return-d.- Returns:
- Always return non-
nullvalidString. If an attempt is made to access a non-existent index, this method throws appropriateCmdLineException. - Throws:
CmdLineException
-
size
public int size()Description copied from interface:ParametersNumber of remaining tokens.- Specified by:
sizein interfaceParameters
-
splitToken
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"
-