org.apache.bcel.generic
Class Select
- Cloneable, InstructionTargeter, Serializable, StackProducer, VariableLengthInstruction
public abstract class Select
Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.
We use our super's
target
property as the default target.
$Id: Select.java 386056 2006-03-15 11:31:56Z tcurdt $
Select() - Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction().
|
Select(short opcode, int[] match, InstructionHandle[] targets, InstructionHandle defaultTarget) - (Match, target) pairs for switch.
|
containsTarget , dispose , dump , getIndex , getTarget , getTargetOffset , getTargetOffset , initFromFile , notifyTarget , setTarget , toString , updatePosition , updateTarget |
accept , className , consumeStack , copy , dispose , dump , equals , getComparator , getLength , getName , getOpcode , initFromFile , produceStack , readInstruction , setComparator , setOpcode , 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
Select
(package private) Select()
Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction(). Not to be used otherwise.
Select
(package private) Select(short opcode,
int[] match,
InstructionHandle[] targets,
InstructionHandle defaultTarget)
(Match, target) pairs for switch.
`Match' and `targets' must have the same length of course.
match
- array of matching valuestargets
- instruction targetsdefaultTarget
- default instruction target
clone
protected Object clone()
throws CloneNotSupportedException
dispose
(package private) void dispose()
Inform targets that they're not targeted anymore.
- dispose in interface BranchInstruction
dump
public void dump(DataOutputStream out)
throws IOException
Dump instruction as byte code to stream out.
- dump in interface BranchInstruction
getIndices
public int[] getIndices()
- array of match target offsets
getMatchs
public int[] getMatchs()
setTarget
public void setTarget(int i,
InstructionHandle target)
Set branch target for `i'th case
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