org.aspectj.apache.bcel.generic
Class BranchHandle

java.lang.Object
  extended by org.aspectj.apache.bcel.generic.InstructionHandle
      extended by org.aspectj.apache.bcel.generic.BranchHandle
All 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.5 2009/10/05 17:35:36 aclement Exp $
Author:
M. Dahm
See Also:
InstructionHandle, Instruction, InstructionList, Serialized Form

Method Summary
 int getPosition()
           
 InstructionHandle getTarget()
           
 void setInstruction(Instruction i)
          Set new contents.
 void setTarget(InstructionHandle ih)
          Pass new target to instruction.
 void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
          Update target of instruction.
 
Methods inherited from class org.aspectj.apache.bcel.generic.InstructionHandle
addTargeter, getInstruction, getNext, getPrev, getTargeters, getTargetersCopy, hasTargeters, removeAllTargeters, removeTargeter, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getPosition

public int getPosition()
Overrides:
getPosition in class InstructionHandle
Returns:
the position, i.e., the byte code offset of the contained instruction. This is accurate only after InstructionList.setPositions() has been called.

setTarget

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


updateTarget

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


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 class InstructionHandle