org.apache.bcel.generic
Class BranchInstruction
- java.lang.Object
-
- org.apache.bcel.generic.Instruction
-
- org.apache.bcel.generic.BranchInstruction
-
- All Implemented Interfaces:
- java.lang.Cloneable, InstructionTargeter
- Direct Known Subclasses:
- GotoInstruction, IfInstruction, JsrInstruction, Select
public abstract class BranchInstruction extends Instruction implements InstructionTargeter
Abstract super class for branching instructions like GOTO, IFEQ, etc.. Branch instructions may have a variable length, namely GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.- See Also:
InstructionList
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancontainsTarget(InstructionHandle ih)Checks whether this targeter targets the specified instruction handle.voiddump(java.io.DataOutputStream out)Dump instruction as byte code to stream out.intgetIndex()InstructionHandlegetTarget()voidsetTarget(InstructionHandle target)Set branch targetjava.lang.StringtoString(boolean verbose)Long output format: <position in byte code> <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"<target instruction>">" "@"<branch target offset>voidupdateTarget(InstructionHandle old_ih, InstructionHandle new_ih)Replaces the target of this targeter from this old handle to the new handle.-
Methods inherited from class org.apache.bcel.generic.Instruction
accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, toString, toString
-
-
-
-
Method Detail
-
dump
public void dump(java.io.DataOutputStream out) throws java.io.IOExceptionDump instruction as byte code to stream out.- Overrides:
dumpin classInstruction- Parameters:
out- Output stream- Throws:
java.io.IOException
-
toString
public 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>- Overrides:
toStringin classInstruction- Parameters:
verbose- long/short format switch- Returns:
- mnemonic for instruction
-
getIndex
public final int getIndex()
- Returns:
- target offset in byte code
-
getTarget
public InstructionHandle getTarget()
- Returns:
- target of branch instruction
-
setTarget
public void setTarget(InstructionHandle target)
Set branch target- Parameters:
target- branch target
-
updateTarget
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
Description copied from interface:InstructionTargeterReplaces the target of this targeter from this old handle to the new handle.- Specified by:
updateTargetin interfaceInstructionTargeter- Parameters:
old_ih- old targetnew_ih- new target
-
containsTarget
public boolean containsTarget(InstructionHandle ih)
Description copied from interface:InstructionTargeterChecks whether this targeter targets the specified instruction handle.- Specified by:
containsTargetin interfaceInstructionTargeter- Returns:
- true, if ih is target of this instruction
-
-
DataMelt 3.0 © DataMelt by jWork.ORG