APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.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().
See Also
InstructionHandle, Instruction, InstructionList

Field Summary

Modifier and TypeField and Description
private BranchInstruction
Inherited from com.sun.org.apache.bcel.internal.generic.InstructionHandle:
EMPTY_ARRAYEMPTY_INSTRUCTION_TARGETER_ARRAYi_position

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static BranchHandle
getBranchHandle(final BranchInstruction i)

Factory method.

public int
public InstructionHandle
getTarget()

Returns: target of instruction.

public void
pack-priv void
setPosition(final int pos)

Overrides com.sun.org.apache.bcel.internal.generic.InstructionHandle.setPosition.

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

public void
setTarget(final InstructionHandle ih)

Pass new target to instruction.

protected int
updatePosition(final int offset, final int maxOffset)

Overrides com.sun.org.apache.bcel.internal.generic.InstructionHandle.updatePosition.

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

public void
updateTarget(final InstructionHandle oldIh, final InstructionHandle newIh)

Update target of instruction.

Inherited from com.sun.org.apache.bcel.internal.generic.InstructionHandle:
acceptaddAttributeaddHandleaddTargeterdisposegetAttributegetAttributesgetInstructiongetInstructionHandlegetNextgetPrevgetTargetershasTargetersremoveAllTargetersremoveAttributeremoveTargetersetNextsetPrevswapInstructiontoStringtoString

Field Detail

biback to summary
private BranchInstruction bi

Constructor Detail

BranchHandleback to summary
private BranchHandle(final BranchInstruction i)

Method Detail

getBranchHandleback to summary
pack-priv static BranchHandle getBranchHandle(final BranchInstruction i)

Factory method.

getPositionback to summary
public int getPosition()

Overrides com.sun.org.apache.bcel.internal.generic.InstructionHandle.getPosition.

Annotations
@Override
getTargetback to summary
public InstructionHandle getTarget()
Returns:InstructionHandle

target of instruction.

setInstructionback to summary
public void setInstruction(final Instruction i)

Overrides com.sun.org.apache.bcel.internal.generic.InstructionHandle.setInstruction.

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

Annotations
@Override
setPositionback to summary
pack-priv void setPosition(final int pos)

Overrides com.sun.org.apache.bcel.internal.generic.InstructionHandle.setPosition.

Doc from com.sun.org.apache.bcel.internal.generic.InstructionHandle.setPosition.

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

Annotations
@Override
setTargetback to summary
public void setTarget(final InstructionHandle ih)

Pass new target to instruction.

updatePositionback to summary
protected int updatePosition(final int offset, final int maxOffset)

Overrides com.sun.org.apache.bcel.internal.generic.InstructionHandle.updatePosition.

Doc from com.sun.org.apache.bcel.internal.generic.InstructionHandle.updatePosition.

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.

Annotations
@Override
updateTargetback to summary
public void updateTarget(final InstructionHandle oldIh, final InstructionHandle newIh)

Update target of instruction.