org.apache.bcel.generic
Class Select
java.lang.Object
  |
  +--org.apache.bcel.generic.Instruction
        |
        +--org.apache.bcel.generic.BranchInstruction
              |
              +--org.apache.bcel.generic.Select
- All Implemented Interfaces: 
- java.lang.Cloneable, InstructionTargeter, java.io.Serializable, StackProducer, VariableLengthInstruction
- Direct Known Subclasses: 
- LOOKUPSWITCH, TABLESWITCH
- public abstract class Select- extends BranchInstruction- implements VariableLengthInstruction, StackProducer
Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.
- Version:
- $Id: Select.java,v 1.2 2002/04/26 09:30:11 mdahm Exp $
- Author:
- M. Dahm
- See Also:
- LOOKUPSWITCH,- TABLESWITCH,- InstructionList, 
Serialized Form
 
 
 
 
 
| Methods inherited from class org.apache.bcel.generic.Instruction | 
| accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, produceStack, readInstruction, setComparator, toString, toString | 
 
| Methods inherited from class java.lang.Object | 
| clone, finalize, getClass, hashCode, notify, notifyAll, 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
padding
protected int padding
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.
 
- 
- Overrides:
- updatePositionin class- BranchInstruction
 
- 
- 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
 
dump
public void dump(java.io.DataOutputStream out)
          throws java.io.IOException
- Dump instruction as byte code to stream out.
 
- 
- Overrides:
- dumpin class- BranchInstruction
 
- 
- Parameters:
- out- Output stream
- java.io.IOException
 
initFromFile
protected void initFromFile(ByteSequence bytes,
                            boolean wide)
                     throws java.io.IOException
- Read needed data (e.g. index) from file.
 
- 
- Overrides:
- initFromFilein class- BranchInstruction
 
- 
- Parameters:
- bytes- input stream
- wide- wide prefix?
- java.io.IOException
- See Also:
- InstructionList
 
toString
public java.lang.String toString(boolean verbose)
- Description copied from class: BranchInstruction
- Long output format:
 <position in byte code>
 <name of opcode> "["<opcode number>"]" 
 "("<length of instruction>")"
 "<"<target instruction>">" "@"<branch target offset>
 
- 
- Overrides:
- toStringin class- BranchInstruction
 
- 
- Parameters:
- verbose- long/short format switch
- Returns:
- mnemonic for instruction
 
setTarget
public void setTarget(int i,
                      InstructionHandle target)
- Set branch target for `i'th case
 
- 
 
- 
 
updateTarget
public void updateTarget(InstructionHandle old_ih,
                         InstructionHandle new_ih)
- 
- Specified by:
- updateTargetin interface- InstructionTargeter
- Overrides:
- updateTargetin class- BranchInstruction
 
- 
- Parameters:
- old_ih- old target
- new_ih- new target
 
containsTarget
public boolean containsTarget(InstructionHandle ih)
- 
- Specified by:
- containsTargetin interface- InstructionTargeter
- Overrides:
- containsTargetin class- BranchInstruction
 
- 
- Returns:
- true, if ih is target of this instruction
 
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
 
Copyright © 2002-2003 Apache Software Foundation. All Rights Reserved.