org.jagatoo.commands
Class NoParamCommandBase
java.lang.Object
org.jagatoo.commands.CommandBase
org.jagatoo.commands.NoParamCommandBase
- All Implemented Interfaces:
- Command, NoParamCommand
- Direct Known Subclasses:
- InputActionCommand
public abstract class NoParamCommandBase
- extends CommandBase
- implements NoParamCommand
This abstract base class for the Command interface correctly overrides
the CommandBase.hashCode() and CommandBase.equals(Object) methods.
This implementation is especially menat for Commands without any
parameters.
|
Method Summary |
java.lang.String |
execute(java.lang.Boolean inputInfo,
java.lang.Object[] parameters)
Executes this command. |
java.lang.String[] |
getParameterTypes()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
NoParamCommandBase
protected NoParamCommandBase(java.lang.String key,
java.lang.String text,
int numParams)
NoParamCommandBase
protected NoParamCommandBase(java.lang.String key,
int numParams)
NoParamCommandBase
public NoParamCommandBase(java.lang.String key,
java.lang.String text)
NoParamCommandBase
public NoParamCommandBase(java.lang.String key)
getParameterTypes
public java.lang.String[] getParameterTypes()
-
- Specified by:
getParameterTypes in interface Command
- Returns:
- an array containing the String representation of the parameter types used for highlighting.
execute
public java.lang.String execute(java.lang.Boolean inputInfo,
java.lang.Object[] parameters)
throws CommandException
- Executes this command.
If a CommandException is thrown, then only its info text is displayed.
- Specified by:
execute in interface Command
- Parameters:
inputInfo - this Boolean is true for a key-down or wheel-up and false for a key-up or wheel-down.
The Command implementation must be aware of the fact, that this Boolean can be null.parameters - the command's parameters
- Returns:
- this command's result if successful.
Used to give the user a textual response to the command execution.
May be null for simple commands.
- Throws:
CommandException