public class StrictInstructionList extends Instruction
Constructing a strict instruction list is usually accomplished by creating an
object and repeatedly calling add
to add new instructions. The
order in which instructions are added is the order in which they'll be
executed.
Modifier and Type | Field and Description |
---|---|
private java.util.List<Instruction> |
myInstructionList |
gelementsToValue
Constructor and Description |
---|
StrictInstructionList()
Construct an empty list of instructions.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Instruction instruction)
Add an instruction to this list (FIFO order for execution).
|
java.lang.Object |
evaluate(Context c)
Evaluate this instruction in a Context, return the result of the
evaluation (the result is the last instruction executed).
|
java.util.Iterator<Instruction> |
iterator()
Return an iterator for accessing all the instructions.
|
java.lang.String |
toString()
Return a string indicating the # of instructions in the list
|
private java.util.List<Instruction> myInstructionList
public StrictInstructionList()
public void add(Instruction instruction)
instruction
- the instruction added.public java.lang.Object evaluate(Context c)
evaluate
in class Instruction
c
- the context for the evaluationpublic java.util.Iterator<Instruction> iterator()
public java.lang.String toString()
toString
in class java.lang.Object