org.jagatoo.commands
Class NoParamCommandBase

java.lang.Object
  extended by org.jagatoo.commands.CommandBase
      extended by 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.


Field Summary
 
Fields inherited from class org.jagatoo.commands.CommandBase
paramsArray
 
Constructor Summary
  NoParamCommandBase(java.lang.String key)
           
protected NoParamCommandBase(java.lang.String key, int numParams)
           
  NoParamCommandBase(java.lang.String key, java.lang.String text)
           
protected NoParamCommandBase(java.lang.String key, java.lang.String text, int numParams)
           
 
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 org.jagatoo.commands.CommandBase
createParametersArray, equals, execute, execute, execute, getKey, getLocalizedText, getNumParameters, getText, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jagatoo.commands.NoParamCommand
execute
 
Methods inherited from interface org.jagatoo.commands.Command
createParametersArray, execute, execute, execute, getKey, getLocalizedText, getNumParameters, getText
 

Constructor Detail

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)
Method Detail

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