|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 FormField Summary | |
---|---|
protected int |
index
|
protected int |
position
|
protected InstructionHandle |
target
|
Fields inherited from class org.apache.bcel.generic.Instruction |
---|
length, opcode |
Constructor Summary | |
---|---|
protected |
BranchInstruction(short opcode,
InstructionHandle target)
Common super constructor |
Method Summary | |
---|---|
boolean |
containsTarget(InstructionHandle ih)
|
void |
dump(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. |
void |
setTarget(InstructionHandle target)
Set branch target |
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 |
---|
protected BranchInstruction(short opcode, InstructionHandle target)
opcode
- Instruction opcodetarget
- instruction to branch toMethod Detail |
---|
public void dump(DataOutputStream out) throws IOException
dump
in class Instruction
out
- Output stream
IOException
protected 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 String toString(boolean verbose)
toString
in class Instruction
verbose
- long/short format switch
protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
initFromFile
in class Instruction
bytes
- input streamwide
- wide prefix?
IOException
InstructionList
public final int getIndex()
public InstructionHandle getTarget()
public void setTarget(InstructionHandle target)
target
- branch targetpublic void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
updateTarget
in interface InstructionTargeter
old_ih
- old targetnew_ih
- new targetpublic boolean containsTarget(InstructionHandle ih)
containsTarget
in interface InstructionTargeter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |