|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hecl.Operator
public abstract class Operator
The Operator class implements a number of features
that are used in the creation of groups of commands, such as those
found in InterpCmds, ListCmds, and so on.
| Field Summary | |
|---|---|
protected int |
cmdcode
cmdcode - the int that corresponds to the command
to be executed. |
protected int |
maxargs
maxargs - the maximum number of arguments this
command accepts. |
protected int |
minargs
minargs - the minimum number of arguments this
command accepts. |
| Constructor Summary | |
|---|---|
protected |
Operator(int cmdcode,
int minargs,
int maxargs)
Creates a new Operator instance. |
| Method Summary | |
|---|---|
Thing |
cmdCode(Interp interp,
Thing[] argv)
The cmdCode method dispatches to the actual code
via the operate method and cmdcode argument. |
protected static void |
load(Interp ip,
java.util.Hashtable cmdtable)
The load method loads the commands in a class that
extends Operator. |
abstract Thing |
operate(int cmdcode,
Interp interp,
Thing[] argv)
The operate method dispatches to the actual code. |
protected static void |
unload(Interp ip,
java.util.Hashtable cmdtable)
The unload method unloads the commands in a class
that extends Operator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int cmdcode
cmdcode - the int that corresponds to the command
to be executed.
protected int minargs
minargs - the minimum number of arguments this
command accepts.
protected int maxargs
maxargs - the maximum number of arguments this
command accepts. A value of 0 means unlimited arguments.
| Constructor Detail |
|---|
protected Operator(int cmdcode,
int minargs,
int maxargs)
Operator instance.
cmdcode - an int value corresponding to the
command code number found in the class implementing the
command.minargs - an int value - the minimum number
of arguments to the command.maxargs - an int value - the maximum number
of arguments to the command, or -1 if unlimited.| Method Detail |
|---|
public Thing cmdCode(Interp interp,
Thing[] argv)
throws HeclException
cmdCode method dispatches to the actual code
via the operate method and cmdcode argument.
cmdCode in interface Commandinterp - an Interp valueargv - a Thing[] value
Thing, or null when no value has been
computed.
HeclException - if an error occurs
public abstract Thing operate(int cmdcode,
Interp interp,
Thing[] argv)
throws HeclException
operate method dispatches to the actual code.
cmdcode - an int valueinterp - an Interp valueargv - a Thing[] value
Thing value, or null when no value has been
HeclException - if an error occurs
protected static void load(Interp ip,
java.util.Hashtable cmdtable)
throws HeclException
load method loads the commands in a class that
extends Operator.
ip - an Interp value
HeclException - if an error occurs
protected static void unload(Interp ip,
java.util.Hashtable cmdtable)
throws HeclException
unload method unloads the commands in a class
that extends Operator.
ip - an Interp value
HeclException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||