|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectavrora.util.Option
The Option class represents an option that has been given on the
command line. The inner classes represent specific types of options such
as integers, booleans, and strings.
Options| Nested Class Summary | |
static class |
Option.Bool
The Option.Bool class is an implementation of the
Option class that encapsulates a boolean. |
static class |
Option.Double
The Option.Double class is an implementation of the
Option class that encapsulates a double value. |
static class |
Option.Interval
The Option.Long class is an implementation of the
Option class that encapsulates a long integer value. |
static class |
Option.List
The Option.List class is an implementation of the
Option class that encapsulates a list. |
static class |
Option.Long
The Option.Long class is an implementation of the
Option class that encapsulates a long integer value. |
static class |
Option.Str
The Option.Str class is an implementation of the
Option class that encapsulates a string. |
| Field Summary | |
static java.util.Comparator |
COMPARATOR
The OptionComparator is an implementation of the
java.util.Comparator interface that is used to sort options
alphabetically for printing in the help system. |
protected java.lang.String |
description
The description field stores a reference to the string
that represents the help item for this option. |
protected java.lang.String |
name
The name field stores a reference to the string name of
this option. |
| Constructor Summary | |
Option(java.lang.String n,
java.lang.String d)
The constructor of the Option class creates a new option
with the specified name and description. |
|
| Method Summary | |
java.lang.String |
getName()
The getName() method returns the string name of the option. |
protected void |
parseError(java.lang.String name,
java.lang.String type,
java.lang.String val)
The parseError() method is called by an option implementation
when there is a problem parsing the value for an option supplied by the user
on the command line. |
void |
printDescription()
The printDescription() method prints out a well-formatted
representation of the description of the item to the terminal. |
void |
printHeader(java.lang.String type,
java.lang.String defvalue)
The printHeader() method prints out the first line of the
help text for this item. |
abstract void |
printHelp()
The printHelp() method prints out a textual paragraph of the
help item for this option to the terminal. |
abstract void |
set(java.lang.String val)
The set() method updates the value of the option. |
abstract java.lang.String |
stringValue()
The stringValue() method returns a string representation of
the value of the option. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final java.lang.String name
name field stores a reference to the string name of
this option.
protected final java.lang.String description
description field stores a reference to the string
that represents the help item for this option.
public static final java.util.Comparator COMPARATOR
OptionComparator is an implementation of the
java.util.Comparator interface that is used to sort options
alphabetically for printing in the help system.
| Constructor Detail |
public Option(java.lang.String n,
java.lang.String d)
Option class creates a new option
with the specified name and description.
n - a string name of the optiond - the description, as an unformatted string, of the help item for
this option| Method Detail |
public java.lang.String getName()
getName() method returns the string name of the option. This
name is the same name used at the command line; i.e. -name=value.
public abstract void set(java.lang.String val)
set() method updates the value of the option. It is passed
a string that is converted to the option's value by each respective option
implementation. For example, an integer option converts the string from an
integer into an integer value.
val - the string value passed at the command linepublic abstract java.lang.String stringValue()
stringValue() method returns a string representation of
the value of the option. This is used in debugging and reporting purposes.
public abstract void printHelp()
printHelp() method prints out a textual paragraph of the
help item for this option to the terminal.
public void printDescription()
printDescription() method prints out a well-formatted
representation of the description of the item to the terminal.
public void printHeader(java.lang.String type,
java.lang.String defvalue)
printHeader() method prints out the first line of the
help text for this item. This includes the option's name, type, and its
default value.
type - the type of the item as a stringdefvalue - the default value for the item as a string
protected void parseError(java.lang.String name,
java.lang.String type,
java.lang.String val)
parseError() method is called by an option implementation
when there is a problem parsing the value for an option supplied by the user
on the command line. For example, if an integer is not in the correct format,
this method will be called, which will report an error.
name - the name of the optionval - the (invalid) value passed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||