|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.tomp.xtcl.command.AbstractCommand
public class AbstractCommand
Base class for (almost all) built-in Commands in XTCL. Provides utility instance methods such as done, initParameters, and static methods: listMap,...
Constructor Summary | |
---|---|
AbstractCommand()
|
Method Summary | |
---|---|
int |
done(Context c,
int i)
Executed always after the command itself. |
int |
execute(Context c)
Do-nothing execution of an empty command. |
protected static int |
initParameters(java.util.Map params,
java.util.Map realParams,
Parametrized f,
Context context)
DOCUMENT ME! |
static java.lang.String |
listArray(java.lang.Object[] os)
Prettyprints an object array to a String |
static java.lang.String |
listList(java.util.List m)
As listArray but for Lists |
static java.lang.String |
listMap(java.util.Map m)
Prettyprints a Map |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractCommand()
Method Detail |
---|
public int execute(Context c) throws java.lang.Exception
execute
in interface Command
c
- Context this command will be executed in.
java.lang.Exception
- only if I/O error occurs when reporting the result to user.public int done(Context c, int i) throws java.lang.Exception
c
- Contexti
- result of previously called Command
java.lang.Exception
- if I/O error occurs when reporting the result to user.protected static int initParameters(java.util.Map params, java.util.Map realParams, Parametrized f, Context context)
params
- contains formal parameters pairs (key->value)
the values are used as keys to refer objects in the context
values of such references are set to Parametrized f and
put to realParamsrealParams
- here the real parameter pairs are putf
- here the real parameter pairs are setcontext
- context to get the real params from
public static java.lang.String listArray(java.lang.Object[] os)
os
- the array to be formatted
public static java.lang.String listList(java.util.List m)
m
- the List to be formatted
public static java.lang.String listMap(java.util.Map m)
m
- the Map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |