|
getopt-0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface representing a program option.
Field Summary | |
static int |
BOOLEAN_ARG
An indicator used when the program option takes a boolean argument. |
static int |
COUNT_ARG
An indicator used when the program option takes as it's argument the number of times the option appears on the command line. |
static int |
INTEGER_ARG
An indicator used when the program option takes an integer argument. |
static int |
LIST_ARG
An indicator used when the program option takes a list of arguments. |
static int |
NESTED_ARG
|
static int |
NO_ARG
An indicator used when the program option takes no arguments. |
static int |
NUMERIC_ARG
An indicator used when the program option takes a numeric argument. |
static int |
REAL_ARG
An indicator used when the program option takes an real argument. |
static int |
SCALAR_ARG
An indicator used when the program option takes a scalar argument. |
static int |
STRING_ARG
An indicator used when the program option takes a string argument. |
Method Summary | |
void |
clear()
Reinitializes this Option to it's default state. |
Object |
clone()
Creates and returns a copy of this object. |
Option |
createNewInstance()
Creates an Option of the same class as this
Option . |
Object |
getArg()
Returns the argument for this program option. |
int |
getArgType()
Returns the argument type for this program option. |
char |
getChar()
Returns the short name of this program option. |
Character |
getCharacter()
Returns the short name of this program option. |
String |
getName()
Returns the long name for this program option. |
boolean |
isArgOptional()
Returns whether the argument for this Option is
optional |
void |
runMethod()
Invokes the Runnable object that is to be run if this
program option is found. |
void |
runMethod(Object arg)
Deprecated. |
void |
setArg(Object arg)
Sets the argument for this program option. |
void |
setArgOptional(boolean argOptional)
Sets whether the argument for this Option is
optional |
void |
setArgType(int argType)
Sets the argument type for this program option. |
void |
setChar(char c)
Sets the short name of this program option. |
void |
setCharacter(Character c)
Sets the short name of this program option. |
void |
setMethod(OptionMethod method)
Sets the Runnable object to invoke if the program
option is found. |
void |
setName(String name)
Sets the long name for this program option. |
Field Detail |
public static final int NO_ARG
public static final int SCALAR_ARG
public static final int STRING_ARG
public static final int INTEGER_ARG
An indicator used when the program option takes an integer argument.
NOTE:
Integer being defined in the mathematical sense, not strictly an
Integer
type in Java.
public static final int REAL_ARG
An indicator used when the program option takes an real argument.
public static final int LIST_ARG
public static final int NESTED_ARG
public static final int BOOLEAN_ARG
public static final int COUNT_ARG
public static final int NUMERIC_ARG
Method Detail |
public void setName(String name)
name
- the name for this optionpublic String getName()
public void setArg(Object arg)
arg
- the argument for this program optionpublic Object getArg()
public void setArgType(int argType)
argType
- The type of argument this program option takes.NO_ARG
SCALAR_ARG
STRING_ARG
LIST_ARG
COUNT_ARG
NUMERIC_ARG
REAL_ARG
INTEGER_ARG
BOOLEAN_ARG
public int getArgType()
setArgType(int)
public void setArgOptional(boolean argOptional)
Option
is
optionalOption
is optionalpublic boolean isArgOptional()
Option
is
optionalOption
is
optionalpublic void clear()
Option
to it's default state.public void setChar(char c)
c
- the short name of this program optionpublic char getChar()
public void setCharacter(Character c)
c
- the short name of this program optionpublic Character getCharacter()
public void setMethod(OptionMethod method)
Runnable
object to invoke if the program
option is found.method
- the object to invokepublic void runMethod()
Runnable
object that is to be run if this
program option is found.public void runMethod(Object arg)
Runnable
object that is to be run if this
program option is found.arg
- the argumentpublic Object clone()
Cloneable
,
Object.clone()
public Option createNewInstance()
Option
of the same class as this
Option
.
This is similar to the clone
method except none of the
data contained in the object is copied.
clone()
|
getopt-0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |