Top Description Fields Constructors Methods
org.aspectj.apache.bcel.generic

public final Class BranchHandle

extends InstructionHandle
Class Inheritance

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().
Author
M. Dahm
Version
$Id: BranchHandle.java,v 1.5 2009/10/05 17:35:36 aclement Exp $
See Also
InstructionHandle, Instruction, InstructionList

Field Summary

Modifier and TypeField and Description
private InstructionBranch
Inherited from org.aspectj.apache.bcel.generic.InstructionHandle:
instructionnextposprev

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static final BranchHandle
public int
public InstructionHandle

Returns:

target of instruction.
getTarget
()

public void
pack-priv void
setPosition(int pos)

Overrides org.aspectj.apache.bcel.generic.InstructionHandle.setPosition.

Set the position, i.e., the byte code offset of the contained instruction.
public void
setTarget(InstructionHandle ih)

Pass new target to instruction.

protected int

Returns:

additional offset caused by possible change of this instruction's length
updatePosition
(int
additional offset caused by preceding (variable length) instructions
offset
,
int
the maximum offset that may be caused by these instructions
max_offset
)

Called by InstructionList.setPositions when setting the position for every instruction.

public void
updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)

Update target of instruction.

Inherited from org.aspectj.apache.bcel.generic.InstructionHandle:
addTargeterdisposegetInstructiongetInstructionHandlegetNextgetPrevgetTargetersgetTargetersCopyhasTargetersremoveAllTargetersremoveTargetertoStringtoString

Field Detail

biback to summary
private InstructionBranch bi

Constructor Detail

BranchHandleback to summary
private BranchHandle(InstructionBranch i)

Method Detail

getBranchHandleback to summary
pack-priv static final BranchHandle getBranchHandle(InstructionBranch i)
getPositionback to summary
public int getPosition()

Overrides org.aspectj.apache.bcel.generic.InstructionHandle.getPosition.

Returns:int

Doc from org.aspectj.apache.bcel.generic.InstructionHandle.getPosition.

the position, i.e., the byte code offset of the contained instruction. This is accurate only after InstructionList.setPositions() has been called.

getTargetback to summary
public InstructionHandle getTarget()
Returns:InstructionHandle

target of instruction.

setInstructionback to summary
public void setInstruction(Instruction i)

Overrides org.aspectj.apache.bcel.generic.InstructionHandle.setInstruction.

Set new contents. Old instruction is disposed and may not be used anymore.

setPositionback to summary
pack-priv void setPosition(int pos)

Overrides org.aspectj.apache.bcel.generic.InstructionHandle.setPosition.

Doc from org.aspectj.apache.bcel.generic.InstructionHandle.setPosition.

Set the position, i.e., the byte code offset of the contained instruction.

setTargetback to summary
public void setTarget(InstructionHandle ih)

Pass new target to instruction.

updatePositionback to summary
protected int updatePosition(int offset, int max_offset)

Called by InstructionList.setPositions when setting the position for every instruction. In the presence of variable length instructions 'setPositions()' performs multiple passes over the instruction list to calculate the correct (byte) positions and offsets by calling this function.

Parameters
offset:int

additional offset caused by preceding (variable length) instructions

max_offset:int

the maximum offset that may be caused by these instructions

Returns:int

additional offset caused by possible change of this instruction's length

updateTargetback to summary
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)

Update target of instruction.