Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.getopt
Class LongOpt  view LongOpt download LongOpt.java

java.lang.Object
  extended bygnu.getopt.LongOpt

public class LongOpt
extends java.lang.Object

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

Field Summary
private  java.util.ResourceBundle _messages
          Localized strings for error messages
protected  java.lang.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  java.lang.String name
          The name of the long option
static int NO_ARGUMENT
          Constant value used for the "has_arg" constructor argument.
static int OPTIONAL_ARGUMENT
          Constant value used for the "has_arg" constructor argument.
static int REQUIRED_ARGUMENT
          Constant value used for the "has_arg" constructor argument.
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
LongOpt(java.lang.String name, int has_arg, java.lang.StringBuffer flag, int val)
          Create a new LongOpt object with the given parameter values.
 
Method Summary
 java.lang.StringBuffer getFlag()
          Returns the value of the 'flag' field for this long option
 int getHasArg()
          Returns the value set for the 'has_arg' field for this long option
 java.lang.String getName()
          Returns the name of this LongOpt as a String
 int getVal()
          Returns the value of the 'val' field for this long option
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ARGUMENT

public static final int NO_ARGUMENT
Constant value used for the "has_arg" constructor argument. This value indicates that the option takes no argument.

See Also:
Constant Field Values

REQUIRED_ARGUMENT

public static final int REQUIRED_ARGUMENT
Constant value used for the "has_arg" constructor argument. This value indicates that the option takes an argument that is required.

See Also:
Constant Field Values

OPTIONAL_ARGUMENT

public static final int OPTIONAL_ARGUMENT
Constant value used for the "has_arg" constructor argument. This value indicates that the option takes an argument that is optional.

See Also:
Constant Field Values

name

protected java.lang.String name
The name of the long option


has_arg

protected int has_arg
Indicates whether the option has no argument, a required argument, or an optional argument.


flag

protected java.lang.StringBuffer flag
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.


val

protected int val
The value to store in "flag" if flag is not null, otherwise the equivalent short option character for this long option.


_messages

private java.util.ResourceBundle _messages
Localized strings for error messages

Constructor Detail

LongOpt

public LongOpt(java.lang.String name,
               int has_arg,
               java.lang.StringBuffer flag,
               int val)
        throws java.lang.IllegalArgumentException
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.

Method Detail

getName

public java.lang.String getName()
Returns the name of this LongOpt as a String


getHasArg

public int getHasArg()
Returns the value set for the 'has_arg' field for this long option


getFlag

public java.lang.StringBuffer getFlag()
Returns the value of the 'flag' field for this long option


getVal

public int getVal()
Returns the value of the 'val' field for this long option