gov.sandia.ccaffeine.cmd
Interface CmdAction
- All Known Implementing Classes:
- CmdActionCCA, CmdActionCCAArena, CmdActionCCAConfig, CmdActionCCAConnect, CmdActionCCADebug, CmdActionCCADisconnect, CmdActionCCADisplay, CmdActionCCAGo, CmdActionCCAInstantiate, CmdActionCCALinks, CmdActionCCANoDebug, CmdActionCCANuke, CmdActionCCAPallet, CmdActionCCAPath, CmdActionCCAPortProperties, CmdActionCCAProperties, CmdActionCCARemove, CmdActionCCARepository, CmdActionCCAShell, CmdActionExit, CmdActionGUI, CmdActionGUIAddComponentClass, CmdActionGUIAddProvidesPorts, CmdActionGUIAddUsesPorts, CmdActionGUIConnect, CmdActionGUIDisconnect, CmdActionGUIExit, CmdActionGUIGetProperty, CmdActionGUIInstantiate, CmdActionGUILoad, CmdActionGUIMessage, CmdActionGUIParamCurrent, CmdActionGUIParamDefault, CmdActionGUIParamDialog, CmdActionGUIParamEndDialog, CmdActionGUIParamField, CmdActionGUIParamHelp, CmdActionGUIParamNumberRange, CmdActionGUIParamPrompt, CmdActionGUIParamStringChoice, CmdActionGUIParamTab, CmdActionGUIRemove, CmdActionGUIRevalidate, CmdActionGUISetPortProperty, CmdActionGUISetProperty, CmdActionHelp
public interface CmdAction
Interface to be implemented by each command added to a Cmd interpreter.
Method Summary |
java.lang.String |
argtype()
Describes the args Vector wanted by this Command. |
void |
doIt(CmdContext cc,
java.util.Vector args)
Does the action, called with the global context of the interpreter
// and with a vector that matches the signature given by argtype(). |
java.lang.String |
help()
Returns a string containing the description of this command. |
java.lang.String[] |
names()
name(s) of the function. |
doIt
void doIt(CmdContext cc,
java.util.Vector args)
throws java.io.EOFException
- Does the action, called with the global context of the interpreter
// and with a vector that matches the signature given by argtype().
// The exit Action throws the EOFException.
- Throws:
java.io.EOFException
help
java.lang.String help()
- Returns a string containing the description of this command.
argtype
java.lang.String argtype()
- Describes the args Vector wanted by this Command.
// This is our hack to get around stupid varargs-lessness in java.
// Each character indicates a separate user argument and its type.
// Type checked user input:
// C --> class named by user.
// c --> optional class named by user.
// I --> instance named by user.
// i --> optional instance named by user.
// S --> string token from user.
// s --> optional string token from user.
// K,k --> Long value, optional Long.
// D,d --> Integer value, optional Integer.
// B,b --> Boolean value, optional Boolean.
// G,g --> Double value, optional Double.
// * --> repeat previous character ad infinitum. can only appear last.
// Special (cannot be followed directly by *):
// A --> all of the line after as a single string.
// a --> all of the line (if any) as a single string.
// L --> the list of known CmdActions.
// P --> the command parser itself.
A more extensible scheme of tags for the parser is desirable.
names
java.lang.String[] names()
- name(s) of the function.