| java.lang.Object gnu.getopt.LongOpt
LongOpt | public class LongOpt extends Object (Code) | | This object represents the definition of a long option in the Java port
of GNU getopt. An array of LongOpt objects is passed to the Getopt
object to define the list of valid long options for a given parsing
session. Refer to the getopt documentation for details on the
format of long options.
version: 1.0.5 author: Aaron M. Renn (arenn@urbanophile.com) See Also: Getopt |
Field Summary | |
final public static int | NO_ARGUMENT Constant value used for the "has_arg" constructor argument. | final public static int | OPTIONAL_ARGUMENT Constant value used for the "has_arg" constructor argument. | final public static int | REQUIRED_ARGUMENT Constant value used for the "has_arg" constructor argument. | protected StringBuffer | flag If this variable is not null, then the value stored in "val" is stored
here when this long option is encountered. | protected int | has_arg Indicates whether the option has no argument, a required argument, or
an optional argument. | protected String | name | protected int | val The value to store in "flag" if flag is not null, otherwise the
equivalent short option character for this long option. |
Constructor Summary | |
public | LongOpt(String name, int has_arg, StringBuffer flag, int val) Create a new LongOpt object with the given parameter values. |
NO_ARGUMENT | final public static int NO_ARGUMENT(Code) | | Constant value used for the "has_arg" constructor argument. This
value indicates that the option takes no argument.
|
OPTIONAL_ARGUMENT | final public static int OPTIONAL_ARGUMENT(Code) | | Constant value used for the "has_arg" constructor argument. This
value indicates that the option takes an argument that is optional.
|
REQUIRED_ARGUMENT | final public static int REQUIRED_ARGUMENT(Code) | | Constant value used for the "has_arg" constructor argument. This
value indicates that the option takes an argument that is required.
|
flag | protected StringBuffer flag(Code) | | If this variable is not null, then the value stored in "val" is stored
here when this long option is encountered. If this is null, the value
stored in "val" is treated as the name of an equivalent short option.
|
has_arg | protected int has_arg(Code) | | Indicates whether the option has no argument, a required argument, or
an optional argument.
|
val | protected int val(Code) | | The value to store in "flag" if flag is not null, otherwise the
equivalent short option character for this long option.
|
LongOpt | public LongOpt(String name, int has_arg, StringBuffer flag, int val) throws IllegalArgumentException(Code) | | Create a new LongOpt object with the given parameter values. If the
value passed as has_arg is not valid, then an exception is thrown.
Parameters: name - The long option String. Parameters: has_arg - Indicates whether the option has no argument (NO_ARGUMENT), a required argument (REQUIRED_ARGUMENT) or an optional argument (OPTIONAL_ARGUMENT). Parameters: flag - If non-null, this is a location to store the value of "val" when this option is encountered, otherwise "val" is treated as the equivalent short option character. Parameters: val - The value to return for this long option, or the equivalent single letter option to emulate if flag is null. exception: IllegalArgumentException - If the has_arg param is not one of NO_ARGUMENT, REQUIRED_ARGUMENT or OPTIONAL_ARGUMENT. |
getFlag | public StringBuffer getFlag()(Code) | | Returns the value of the 'flag' field for this long option
The value of 'flag' |
getHasArg | public int getHasArg()(Code) | | Returns the value set for the 'has_arg' field for this long option
The value of 'has_arg' |
getName | public String getName()(Code) | | Returns the name of this LongOpt as a String
Then name of the long option |
getVal | public int getVal()(Code) | | Returns the value of the 'val' field for this long option
The value of 'val' |
|
|