|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jagatoo.commands.CommandBase
public abstract class CommandBase
This abstract base class for the Command interface correctly overrides
the hashCode() and equals(Object) methods.
| Field Summary | |
|---|---|
protected java.lang.Object[] |
paramsArray
|
| Constructor Summary | |
|---|---|
CommandBase(java.lang.String key,
int numParams)
|
|
CommandBase(java.lang.String key,
java.lang.String text,
int numParams)
|
|
| Method Summary | |
|---|---|
java.lang.Object[] |
createParametersArray(java.util.ArrayList<java.lang.String> parameters)
Creates a parameters array for the given command line. |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
execute(java.lang.Boolean inputInfo,
CommandLine commandLine)
Executes this command. |
java.lang.String |
execute(CommandLine commandLine)
Executes this command. |
java.lang.String |
execute(java.lang.Object[] parameters)
Executes this command. |
java.lang.String |
getKey()
|
java.lang.String |
getLocalizedText()
|
int |
getNumParameters()
|
java.lang.String |
getText()
|
int |
hashCode()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jagatoo.commands.Command |
|---|
execute, getParameterTypes |
| Field Detail |
|---|
protected final java.lang.Object[] paramsArray
| Constructor Detail |
|---|
public CommandBase(java.lang.String key,
java.lang.String text,
int numParams)
public CommandBase(java.lang.String key,
int numParams)
| Method Detail |
|---|
public final java.lang.String getKey()
getKey in interface Commandpublic final java.lang.String getText()
getText in interface CommandCommand.Command.getLocalizedText()public java.lang.String getLocalizedText()
getLocalizedText in interface CommandCommand.
You should prefer this method over Command.getText().public final int getNumParameters()
getNumParameters in interface Commandpublic java.lang.Object[] createParametersArray(java.util.ArrayList<java.lang.String> parameters)
Command
createParametersArray in interface Command
public final java.lang.String execute(java.lang.Object[] parameters)
throws CommandException
execute in interface Commandparameters - the command's parameters
CommandException
public java.lang.String execute(java.lang.Boolean inputInfo,
CommandLine commandLine)
throws CommandException
execute in interface CommandinputInfo - 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.commandLine - the CommandLine to extract the parameters array from
CommandException
public java.lang.String execute(CommandLine commandLine)
throws CommandException
execute in interface CommandcommandLine - the CommandLine to extract the parameters array from
CommandExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||