public class IntOption extends java.lang.Object implements CmdLineOption
For example, you can parse "-n 9" or "-n 0" into 9 and 0 respectively.
CmdLineOption.Parameters| Modifier and Type | Field and Description |
|---|---|
boolean |
isSet
True if the option was explicitly set.
|
int |
value
Value of this option.
|
| Constructor and Description |
|---|
IntOption(java.lang.String optionName) |
IntOption(java.lang.String optionName,
int defaultValue) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(java.lang.String optionName)
Checks if this option parser recognizes the specified
option name.
|
int |
parseArguments(CmdLineParser parser,
CmdLineOption.Parameters params)
Called if the option that this parser recognizes is found.
|
public int value
public boolean isSet
public IntOption(java.lang.String optionName)
public IntOption(java.lang.String optionName,
int defaultValue)
public boolean accepts(java.lang.String optionName)
CmdLineOptionaccepts in interface CmdLineOptionpublic int parseArguments(CmdLineParser parser, CmdLineOption.Parameters params) throws CmdLineException
CmdLineOptionparseArguments in interface CmdLineOptionparser - The parser that's using this option object.
For example, if the option "-quiet" is simply an alias to
"-verbose 5", then the implementation can just call the
CmdLineParser.parse(String[]) method recursively.params - The rest of the arguments. This method can use this
object to access the arguments of the option if necessary.CmdLineExceptionCopyright © 2003-2013 Kohsuke Kawaguchi. All Rights Reserved.