org.apache.bcel.generic
Class Select
- Cloneable, InstructionTargeter, Serializable, StackProducer, VariableLengthInstruction
public abstract class Select
Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.
Version:
- M. Dahm
LOOKUPSWITCH
, TABLESWITCH
, InstructionList
containsTarget , dump , getIndex , getTarget , getTargetOffset , getTargetOffset , initFromFile , setTarget , toString , updatePosition , updateTarget |
accept , consumeStack , copy , dump , equals , getComparator , getLength , getName , getOpcode , initFromFile , produceStack , readInstruction , setComparator , toString , toString , toString |
fixed_length
protected int fixed_length
indices
protected int[] indices
match
protected int[] match
match_length
protected int match_length
padding
protected int padding
dump
public void dump(DataOutputStream out)
throws IOException
Dump instruction as byte code to stream out.
- dump in interface BranchInstruction
out
- Output stream
getIndices
public int[] getIndices()
- array of match target offsets
getMatchs
public int[] getMatchs()
- array of match indices
initFromFile
protected void initFromFile(ByteSequence bytes,
boolean wide)
throws IOException
Read needed data (e.g. index) from file.
- initFromFile in interface BranchInstruction
setTarget
public void setTarget(int i,
InstructionHandle target)
Set branch target for `i'th case
toString
public String toString(boolean verbose)
- toString in interface BranchInstruction
- mnemonic for instruction
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.
- updatePosition in interface BranchInstruction
offset
- additional offset caused by preceding (variable length) instructionsmax_offset
- the maximum offset that may be caused by these instructions
- additional offset caused by possible change of this instruction's length