|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.util.help.HelpCategory avrora.actions.Action
The Action
class defines a new action that the main driver is capable of executing. Each
instance of Action
is inserted into a hash map in the main class, with the key being its name.
For example, the action to simulate a program is inserted into this hash map with the key "simulate", and
an instance of avrora.actions.SimulateAction
.
Field Summary | |
Options |
options
The options field stores a reference to an instance of the Options class that
encapsulates the command line options available to this action. |
Fields inherited from class avrora.util.help.HelpCategory |
COMPARATOR, help, name |
Constructor Summary | |
protected |
Action(java.lang.String h)
The constructor for the Action class initializes the referneces to the short name and help
string for this action as well as creating the internal options. |
Method Summary | |
protected Option.Bool |
newOption(java.lang.String name,
boolean val,
java.lang.String desc)
The newOption() is used by subclasses to easily create new options for this action. |
protected Option.Double |
newOption(java.lang.String name,
double val,
java.lang.String desc)
The newOption() is used by subclasses to easily create new options for this action. |
protected Option.Interval |
newOption(java.lang.String name,
long l,
long h,
java.lang.String desc)
The newOption() is used by subclasses to easily create new options for this action. |
protected Option.Long |
newOption(java.lang.String name,
long val,
java.lang.String desc)
The newOption() is used by subclasses to easily create new options for this action. |
protected Option.Str |
newOption(java.lang.String name,
java.lang.String val,
java.lang.String desc)
The newOption() is used by subclasses to easily create new options for this action. |
protected Option.List |
newOptionList(java.lang.String name,
java.lang.String val,
java.lang.String desc)
The newOptionList() is used by subclasses to easily create new options for this action. |
abstract void |
run(java.lang.String[] args)
The run() method is called by the main class and is passed the remaining command line
arguments after options have been stripped out. |
Methods inherited from class avrora.util.help.HelpCategory |
addCommandExample, addListSection, addOptionSection, addSection, addSubcategorySection, getHelp, getName, printHelp, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final Options options
options
field stores a reference to an instance of the Options
class that
encapsulates the command line options available to this action.
Constructor Detail |
protected Action(java.lang.String h)
Action
class initializes the referneces to the short name and help
string for this action as well as creating the internal options.
h
- the (unformatted) help stringMethod Detail |
public abstract void run(java.lang.String[] args) throws java.lang.Exception
run()
method is called by the main class and is passed the remaining command line
arguments after options have been stripped out.
args
- the command line arguments
java.lang.Exception
protected Option.Bool newOption(java.lang.String name, boolean val, java.lang.String desc)
newOption()
is used by subclasses to easily create new options for this action.
name
- the name of the optionval
- the default value of the optiondesc
- a string representation of the help for this option
Option
representing the option created and registeredprotected Option.Long newOption(java.lang.String name, long val, java.lang.String desc)
newOption()
is used by subclasses to easily create new options for this action.
name
- the name of the optionval
- the default value of the optiondesc
- a string representation of the help for this option
Option
representing the option created and registeredprotected Option.Double newOption(java.lang.String name, double val, java.lang.String desc)
newOption()
is used by subclasses to easily create new options for this action.
name
- the name of the optionval
- the default value of the optiondesc
- a string representation of the help for this option
Option
representing the option created and registeredprotected Option.Interval newOption(java.lang.String name, long l, long h, java.lang.String desc)
newOption()
is used by subclasses to easily create new options for this action. This
particular method creates an interval option.
name
- the name of the optionl
- the default low value of the optionh
- the default high value of the optiondesc
- a string representation of the help for this option
Option
representing the option created and registeredprotected Option.Str newOption(java.lang.String name, java.lang.String val, java.lang.String desc)
newOption()
is used by subclasses to easily create new options for this action.
name
- the name of the optionval
- the default value of the option as a stringdesc
- a string representation of the help for this option
Option
representing the option created and registeredprotected Option.List newOptionList(java.lang.String name, java.lang.String val, java.lang.String desc)
newOptionList()
is used by subclasses to easily create new options for this action.
name
- the name of the optionval
- the default value of the option as a comma separated stringdesc
- a string representation of the help for this option
Option
representing the option created and registered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |