|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.biojava.utils.bytecode.Label
public class Label
A Label used to mark a position in byte code.
Labels are used as the targets for jumps, and for exception handlers. Labels can be named. They implement CodeGenerator, which allows them to be added to things like an InstructionVector. The writeCode method takes care of marking the label with the context.
| Field Summary | |
|---|---|
java.lang.String |
name
|
| Constructor Summary | |
|---|---|
Label()
|
|
Label(java.lang.String name)
|
|
| Method Summary | |
|---|---|
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. |
java.lang.String |
toString()
|
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, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String name
| Constructor Detail |
|---|
public Label()
public Label(java.lang.String name)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Object
public void writeCode(CodeContext ctx)
throws CodeException
CodeGenerator
writeCode in interface CodeGeneratorctx - a CodeContext to write to
CodeException - if there was some failure in writing to the contextpublic int stackDepth()
CodeGeneratorFor 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 CodeGeneratorpublic int stackDelta()
CodeGeneratorIn 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 | ||||||||