de.fub.bytecode.generic
Class BranchHandle

java.lang.Object
  |
  +--de.fub.bytecode.generic.InstructionHandle
        |
        +--de.fub.bytecode.generic.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().

Version:
$Id: BranchHandle.java,v 1.9 1999/09/22 13:00:05 dahm Exp $
Author:
M. Dahm
See Also:
InstructionHandle, Instruction, InstructionList, Serialized Form

Fields inherited from class de.fub.bytecode.generic.InstructionHandle
i_position
 
Method Summary
protected  void addHandle()
          Handle adds itself to the list of resuable handles.
 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 de.fub.bytecode.generic.InstructionHandle
addTargeter, getInstruction, getNext, getPrev, getTargeters, hasTargeters, removeAllTargeters, removeTargeter, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

addHandle

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

updatePosition

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

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