org.apache.bcel.generic

Class BranchHandle

Implemented Interfaces:
java.io.Serializable

public final class BranchHandle
extends InstructionHandle

BranchHandle is returned by specialized InstructionList.append() whenever a BranchInstruction is appended. This is useful when the target of this instruction is not known at time of creation and must be set later via setTarget().
Version:
$Id: BranchHandle.java,v 1.1.1.1 2001/10/29 20:00:06 jvanzyl Exp $
Author:
M. Dahm
See Also:
InstructionHandle, Instruction, InstructionList, Serialized Form

Field Summary

Fields inherited from class org.apache.bcel.generic.InstructionHandle

i_position

Method Summary

protected void
addHandle()
Handle adds itself to the list of resuable handles.
int
getPosition()
InstructionHandle
getTarget()
void
setInstruction(Instruction i)
Set new contents.
void
setTarget(InstructionHandle ih)
Pass new target to instruction.
protected int
updatePosition(int offset, int max_offset)
void
updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
Update target of instruction.

Methods inherited from class org.apache.bcel.generic.InstructionHandle

accept, addAttribute, addHandle, addTargeter, getAttribute, getAttributes, getInstruction, getNext, getPosition, getPrev, getTargeters, hasTargeters, removeAllTargeters, removeAttribute, removeTargeter, setInstruction, swapInstruction, toString, toString, updatePosition

Method Details

addHandle

protected void addHandle()
Handle adds itself to the list of resuable handles.
Overrides:
addHandle in interface InstructionHandle

getPosition

public int getPosition()
Overrides:
getPosition in interface InstructionHandle

getTarget

public InstructionHandle getTarget()
Returns:
target of instruction.

setInstruction

public void setInstruction(Instruction i)
Set new contents. Old instruction is disposed and may not be used anymore.
Overrides:
setInstruction in interface InstructionHandle

setTarget

public void setTarget(InstructionHandle ih)
Pass new target to instruction.

updatePosition

protected int updatePosition(int offset,
                             int max_offset)
Overrides:
updatePosition in interface InstructionHandle

updateTarget

public void updateTarget(InstructionHandle old_ih,
                         InstructionHandle new_ih)
Update target of instruction.