jellyj.classfile.classgen
Class BranchInstruction

jellyj.classfile.classgen.Instruction
  |
  +--jellyj.classfile.classgen.BranchInstruction
Direct Known Subclasses:
GOTO, GOTO_W, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, JSR, JSR_W, Select

public abstract class BranchInstruction
extends Instruction

Abstract super class for branching instructions like GOTO, IFEQ, etc.. Branch instructions may have a variable length, namely GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.

Author:
JellyJ Design Group
See Also: InstructionList

Constructor Summary
 (package private) BranchInstruction()
          Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction().

Method Summary
 voiddump(DataOutputStream out)
          Dump instruction as byte code to stream out.
 (package private) final intgetIndex()
           
 InstructionHandlegetTarget()
           
 voidsetTarget(InstructionHandle target)
          Set branch target
 StringtoString()
           

Methods inherited from class jellyj.classfile.classgen.Instruction
consumeStack, copy, getLength, getPosition, getTag, produceStack, readInstruction, setPosition

Constructor Detail

BranchInstruction

BranchInstruction()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise.
Method Detail

dump

public void dump(DataOutputStream out)
throws java.io.IOException
Dump instruction as byte code to stream out.
Parameters:
out - Output stream

getIndex

final int getIndex()
Returns: target offset

getTarget

public InstructionHandle getTarget()
Returns: target of branch instruction

setTarget

public void setTarget(InstructionHandle target)
Set branch target

toString

public String toString()
Returns: mnemonic for instruction

Association Links

to Class jellyj.classfile.classgen.InstructionHandle