Class DE.fub.inf.JVM.ClassGen.Select
java.lang.Object
|
+--DE.fub.inf.JVM.ClassGen.Instruction
|
+--DE.fub.inf.JVM.ClassGen.BranchInstruction
|
+--DE.fub.inf.JVM.ClassGen.Select
- Subclasses:
- LOOKUPSWITCH, TABLESWITCH
- public abstract class Select
- extends BranchInstruction
- implements VariableLengthInstruction
Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.
- Version:
- $Id: Select.java,v 1.3 1998/09/15 08:42:27 dahm Exp $
- Author:
- M. Dahm
- See Also:
- LOOKUPSWITCH, TABLESWITCH, InstructionList, Serialized Form
Methods inherited from class DE.fub.inf.JVM.ClassGen.Instruction |
consumeStack, dump, getInstructionList, getLength, getPosition, getTag, initFromFile, produceStack, readInstruction, setPosition, toString, toString, toString, updatePosition |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
match
protected int[] match
indices
protected int[] indices
targets
protected InstructionHandle[] targets
fixed_length
protected int fixed_length
match_length
protected int match_length
updatePosition
protected int updatePosition(int offset,
int max_offset)
- Since this is a variable length instruction, it may shift the following
instructions which then need to update their position.
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.
- Parameters:
offset
- additional offset caused by preceding (variable length) instructions
max_offset
- the maximum offset that may be caused by these instructions- Returns:
- additional offset caused by possible change of this instruction's length
- Overrides:
- updatePosition in class Instruction
dump
public void dump(java.io.DataOutputStream out)
throws java.io.IOException
- Dump instruction as byte code to stream out.
- Parameters:
out
- Output stream- Overrides:
- dump in class BranchInstruction
initFromFile
protected void initFromFile(ByteSequence bytes,
boolean wide)
throws java.io.IOException
- Read needed data (e.g. index) from file.
- Overrides:
- initFromFile in class BranchInstruction
toString
public java.lang.String toString(boolean verbose)
- Returns:
- mnemonic for instruction
- Overrides:
- toString in class BranchInstruction
getMatchs
public int[] getMatchs()
- Returns:
- array of match indices
getIndices
public int[] getIndices()
- Returns:
- array of match target offsets
getTargets
public InstructionHandle[] getTargets()
- Returns:
- array of match targets