All Packages Class Hierarchy This Package Previous Next Index
Class espresso.classfile.classgen.BranchInstruction
java.lang.Object
|
+----espresso.classfile.classgen.Instruction
|
+----espresso.classfile.classgen.BranchInstruction
- 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.
- See Also:
- InstructionList
-
index
-
-
target
-
-
BranchInstruction()
- Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction().
-
BranchInstruction(short, InstructionHandle)
-
-
dump(DataOutputStream)
- Dump instruction as byte code to stream out.
-
getIndex()
-
-
getTarget()
-
-
getTargetOffset()
-
-
getTargetOffset(Instruction)
-
-
getTargetOffset(InstructionHandle)
-
-
initFromFile(ByteSequence, boolean)
- Read needed data (e.g.
-
setTarget(InstructionHandle)
- Set branch target
-
toString()
-
index
protected int index
target
protected InstructionHandle target
BranchInstruction
BranchInstruction()
- Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction(). Not to be used otherwise.
BranchInstruction
protected BranchInstruction(short tag,
InstructionHandle target)
- Parameters:
- instruction - Target instruction to branch to
dump
public void dump(DataOutputStream out) throws IOException
- Dump instruction as byte code to stream out.
- Parameters:
- out - Output stream
- Overrides:
- dump in class Instruction
getTarget
public InstructionHandle getTarget()
- Returns:
- target of branch instruction
setTarget
public void setTarget(InstructionHandle target)
- Set branch target
getTargetOffset
protected int getTargetOffset(Instruction target)
- Parameters:
- target - branch target
- Returns:
- the offset to `target' relative to this instruction
getTargetOffset
protected int getTargetOffset(InstructionHandle target)
- Parameters:
- target - branch target
- Returns:
- the offset to `target' relative to this instruction
getTargetOffset
protected int getTargetOffset()
- Returns:
- the offset to this instruction's target
toString
public String toString()
- Returns:
- mnemonic for instruction
- Overrides:
- toString in class Instruction
initFromFile
protected void initFromFile(ByteSequence bytes,
boolean wide) throws IOException
- Read needed data (e.g. index) from file. Conversion to a InstructionHandle
is done in InstructionList(byte[]).
- Overrides:
- initFromFile in class Instruction
- See Also:
- InstructionList
getIndex
final int getIndex()
- Returns:
- target offset
All Packages Class Hierarchy This Package Previous Next Index