|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.bcel.generic.Instruction
org.apache.bcel.generic.BranchInstruction
public abstract class BranchInstruction
Abstract super class for branching instructions like GOTO, IFEQ, etc.. Branch instructions may have a variable length, namely GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.
InstructionList,
Serialized Form| Field Summary | |
|---|---|
protected int |
index
|
protected int |
position
|
protected InstructionHandle |
target
|
| Fields inherited from class org.apache.bcel.generic.Instruction |
|---|
length, opcode |
| Constructor Summary | |
|---|---|
(package private) |
BranchInstruction()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). |
protected |
BranchInstruction(short opcode,
InstructionHandle target)
Common super constructor |
| Method Summary | |
|---|---|
boolean |
containsTarget(InstructionHandle ih)
|
(package private) void |
dispose()
Inform target that it's not targeted anymore. |
void |
dump(java.io.DataOutputStream out)
Dump instruction as byte code to stream out. |
int |
getIndex()
|
InstructionHandle |
getTarget()
|
protected int |
getTargetOffset()
|
protected int |
getTargetOffset(InstructionHandle _target)
|
protected void |
initFromFile(ByteSequence bytes,
boolean wide)
Read needed data (e.g. |
(package private) static void |
notifyTarget(InstructionHandle old_ih,
InstructionHandle new_ih,
InstructionTargeter t)
Used by BranchInstruction, LocalVariableGen, CodeExceptionGen |
void |
setTarget(InstructionHandle target)
Set branch target |
java.lang.String |
toString(boolean verbose)
Long output format: <position in byte code> <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"<target instruction>">" "@"<branch target offset> |
protected int |
updatePosition(int offset,
int max_offset)
Called by InstructionList.setPositions when setting the position for every instruction. |
void |
updateTarget(InstructionHandle old_ih,
InstructionHandle new_ih)
|
| Methods inherited from class org.apache.bcel.generic.Instruction |
|---|
accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, produceStack, readInstruction, setComparator, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int index
protected InstructionHandle target
protected int position
| Constructor Detail |
|---|
BranchInstruction()
protected BranchInstruction(short opcode,
InstructionHandle target)
opcode - Instruction opcodetarget - instruction to branch to| Method Detail |
|---|
public void dump(java.io.DataOutputStream out)
throws java.io.IOException
dump in class Instructionout - Output stream
java.io.IOExceptionprotected int getTargetOffset(InstructionHandle _target)
_target - branch target
protected int getTargetOffset()
protected int updatePosition(int offset,
int max_offset)
offset - additional offset caused by preceding (variable length) instructionsmax_offset - the maximum offset that may be caused by these instructions
public java.lang.String toString(boolean verbose)
toString in class Instructionverbose - long/short format switch
protected void initFromFile(ByteSequence bytes,
boolean wide)
throws java.io.IOException
initFromFile in class Instructionbytes - input streamwide - wide prefix?
java.io.IOExceptionInstructionListpublic final int getIndex()
public InstructionHandle getTarget()
public void setTarget(InstructionHandle target)
target - branch target
static final void notifyTarget(InstructionHandle old_ih,
InstructionHandle new_ih,
InstructionTargeter t)
public void updateTarget(InstructionHandle old_ih,
InstructionHandle new_ih)
updateTarget in interface InstructionTargeterold_ih - old targetnew_ih - new targetpublic boolean containsTarget(InstructionHandle ih)
containsTarget in interface InstructionTargetervoid dispose()
dispose in class Instruction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||