| 
 | |||||||||||
| 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
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 | |
| protected  | BranchInstruction(short opcode,
                  InstructionHandle target)Common super constructor | 
| Method Summary | |
|  boolean | containsTarget(InstructionHandle ih) | 
|  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. index) from file. | 
|  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 | 
protected BranchInstruction(short opcode,
                            InstructionHandle target)
target - 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
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 InstructionTargeter| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||