org.apache.bcel.generic

Class BranchHandle

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().

See Also: InstructionHandle Instruction InstructionList

Method Summary
protected voidaddHandle()
Handle adds itself to the list of resuable handles.
intgetPosition()
InstructionHandlegetTarget()
voidsetInstruction(Instruction i)
Set new contents.
voidsetTarget(InstructionHandle ih)
Pass new target to instruction.
protected intupdatePosition(int offset, int max_offset)
voidupdateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
Update target of instruction.

Method Detail

addHandle

protected void addHandle()
Handle adds itself to the list of resuable handles.

getPosition

public int getPosition()

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.

setTarget

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

updatePosition

protected int updatePosition(int offset, int max_offset)

updateTarget

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