proguard.classfile.instruction
Class TableSwitchInstruction

java.lang.Object
  extended by proguard.classfile.instruction.Instruction
      extended by proguard.classfile.instruction.SwitchInstruction
          extended by proguard.classfile.instruction.TableSwitchInstruction

public class TableSwitchInstruction
extends SwitchInstruction

This Instruction represents a simple instruction without variable arguments or constant pool references.


Field Summary
 int highCase
           
 int lowCase
           
 
Fields inherited from class proguard.classfile.instruction.SwitchInstruction
defaultOffset, jumpOffsets
 
Fields inherited from class proguard.classfile.instruction.Instruction
opcode
 
Constructor Summary
TableSwitchInstruction()
          Creates an uninitialized TableSwitchInstruction.
TableSwitchInstruction(byte opcode, int defaultOffset, int lowCase, int highCase, int[] jumpOffsets)
          Creates a new TableSwitchInstruction with the given arguments.
 
Method Summary
 void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, InstructionVisitor instructionVisitor)
          Accepts the given visitor.
 TableSwitchInstruction copy(TableSwitchInstruction tableSwitchInstruction)
          Copies the given instruction into this instruction.
 int length(int offset)
          Returns the length in bytes of the instruction.
protected  void readInfo(byte[] code, int offset)
          Reads the data following the instruction opcode.
 Instruction shrink()
          Shrinks this instruction to its shortest possible form.
protected  void writeInfo(byte[] code, int offset)
          Writes data following the instruction opcode.
 
Methods inherited from class proguard.classfile.instruction.SwitchInstruction
copy, toString, toString
 
Methods inherited from class proguard.classfile.instruction.Instruction
canonicalOpcode, getName, isCategory2, isWide, readByte, readInt, readShort, readSignedByte, readSignedShort, readSignedValue, readValue, stackPopCount, stackPushCount, write, write, writeByte, writeInt, writeShort, writeSignedByte, writeSignedShort, writeSignedValue, writeValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lowCase

public int lowCase

highCase

public int highCase
Constructor Detail

TableSwitchInstruction

public TableSwitchInstruction()
Creates an uninitialized TableSwitchInstruction.


TableSwitchInstruction

public TableSwitchInstruction(byte opcode,
                              int defaultOffset,
                              int lowCase,
                              int highCase,
                              int[] jumpOffsets)
Creates a new TableSwitchInstruction with the given arguments.

Method Detail

copy

public TableSwitchInstruction copy(TableSwitchInstruction tableSwitchInstruction)
Copies the given instruction into this instruction.

Parameters:
tableSwitchInstruction - the instruction to be copied.
Returns:
this instruction.

shrink

public Instruction shrink()
Description copied from class: Instruction
Shrinks this instruction to its shortest possible form.

Specified by:
shrink in class Instruction
Returns:
this instruction.

readInfo

protected void readInfo(byte[] code,
                        int offset)
Description copied from class: Instruction
Reads the data following the instruction opcode.

Specified by:
readInfo in class Instruction

writeInfo

protected void writeInfo(byte[] code,
                         int offset)
Description copied from class: Instruction
Writes data following the instruction opcode.

Specified by:
writeInfo in class Instruction

length

public int length(int offset)
Description copied from class: Instruction
Returns the length in bytes of the instruction.

Specified by:
length in class Instruction

accept

public void accept(Clazz clazz,
                   Method method,
                   CodeAttribute codeAttribute,
                   int offset,
                   InstructionVisitor instructionVisitor)
Description copied from class: Instruction
Accepts the given visitor.

Specified by:
accept in class Instruction