|
Sun Adapter for LDAP API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.stc.connector.ldapadapter.utils.LongOpt
public class LongOpt
This object represents the definition of a long option in getopt. An array of LongOpt objects is passed to the STCGetopt 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.
STCGetopt
Field Summary | |
---|---|
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 |
---|
public static final int NO_ARGUMENT
public static final int REQUIRED_ARGUMENT
public static final int OPTIONAL_ARGUMENT
protected java.lang.String name
protected int has_arg
protected java.lang.StringBuffer flag
protected int val
Constructor Detail |
---|
public LongOpt(java.lang.String name, int has_arg, java.lang.StringBuffer flag, int val) throws java.lang.IllegalArgumentException
name
- The long option String.has_arg
- Indicates whether the option has no argument (NO_ARGUMENT), a required argument (REQUIRED_ARGUMENT) or an optional argument (OPTIONAL_ARGUMENT).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.val
- The value to return for this long option, or the equivalent single letter option to emulate if flag is null.
java.lang.IllegalArgumentException
- If the has_arg param is not one of NO_ARGUMENT, REQUIRED_ARGUMENT or OPTIONAL_ARGUMENT.Method Detail |
---|
public java.lang.String getName()
public int getHasArg()
public java.lang.StringBuffer getFlag()
public int getVal()
|
Sun Adapter for LDAP API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |