|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.memphis.ccrg.lida.framework.gui.commands.CommandImpl
public abstract class CommandImpl
Abstract implementation of Command
.
Extend from this base class to create new commands overriding execute(Agent)
.
Field Summary | |
---|---|
protected java.lang.Object |
result
Result of the command's execution. |
Constructor Summary | |
---|---|
CommandImpl()
|
Method Summary | |
---|---|
abstract void |
execute(Agent agent)
Executes this command performing the necessary actions in the model (the Agent ). |
java.lang.Object |
getParameter(java.lang.String name)
Gets a parameter by name. |
java.lang.Object |
getResult()
Returns result of the command. |
void |
setParameter(java.lang.String name,
java.lang.Object value)
Set single parameter for command. |
void |
setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
Sets optional parameters for command. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object result
execute(Agent)
method.
Constructor Detail |
---|
public CommandImpl()
Method Detail |
---|
public abstract void execute(Agent agent)
Command
Agent
).
execute
in interface Command
agent
- Agent
Objectpublic java.lang.Object getParameter(java.lang.String name)
Command
getParameter
in interface Command
name
- retrieved parameter
public java.lang.Object getResult()
Command
getResult
in interface Command
public void setParameter(java.lang.String name, java.lang.Object value)
Command
setParameter
in interface Command
name
- name of parametervalue
- default value to use if parameter cannot be foundpublic void setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
Command
setParameters
in interface Command
parameters
- parameterspublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |