|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.bytecode.InstructionVector
public class InstructionVector
A list of Instructions and/or other CodeGenerator objects.
Constructor Summary | |
---|---|
InstructionVector()
|
Method Summary | |
---|---|
void |
add(CodeGenerator g)
|
void |
add(int pos,
CodeGenerator g)
|
CodeGenerator |
generatorAt(int pos)
|
Label |
getEndLabel()
|
Label |
getStartLabel()
|
void |
remove(int pos)
|
int |
size()
|
int |
stackDelta()
Return the change in the stack dept this generator will cause. |
int |
stackDepth()
Return the total depth of the stack required by this CodeGenerator. |
void |
writeCode(CodeContext ctx)
Write the byte or bytes for this CodeGenerator to a CodeContext. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InstructionVector()
Method Detail |
---|
public void add(CodeGenerator g)
public int size()
public void add(int pos, CodeGenerator g)
public void remove(int pos)
public CodeGenerator generatorAt(int pos)
public Label getStartLabel()
public Label getEndLabel()
public void writeCode(CodeContext ctx) throws CodeException
CodeGenerator
writeCode
in interface CodeGenerator
ctx
- a CodeContext to write to
CodeException
- if there was some failure in writing to the contextpublic int stackDepth()
CodeGenerator
For single byte-code instructions, this will be the same as stackDelta() if stackDelta() is positive, zero otherwise. For a compound instruction, this will be the maximum stack depth required to execute all sub-instructions.
stackDepth
in interface CodeGenerator
public int stackDelta()
CodeGenerator
In the case of an instruction that adds items to the stack, stackDelta will be positive. For instructions that removes items from the stack, this will be negative.
stackDelta
in interface CodeGenerator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |