alt.jiapi.reflect
Class SwitchInstruction

java.lang.Object
  extended by alt.jiapi.reflect.Instruction
      extended by alt.jiapi.reflect.SwitchInstruction
All Implemented Interfaces:
java.lang.Cloneable

public class SwitchInstruction
extends Instruction

SwitchInstruction represents switch-case construct in Java language jargon. Internally, this class encapsulates different switch instructions in bytecode level. Like tableswitch and lookupswitch.

Author:
Mika Riekkinen

Nested Class Summary
 class SwitchInstruction.Target
          This class encapsulates SwitchInstructions key-target pair.
 
Method Summary
 byte[] getBytes()
          Gets the bytes of this instruction.
 Instruction getDefault()
          Get the default Instruction of this SwitchInstruction.
 SwitchInstruction.Target[] getTargets()
          Gets all the targets of this SwitchInstruction.
 java.lang.String toString()
           
 
Methods inherited from class alt.jiapi.reflect.Instruction
getAttribute, getOffset, getOpcode, length, setAttribute, setAttribute, setBytes, setOffset, stackConsumption, stackUsage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getBytes

public byte[] getBytes()
Description copied from class: Instruction
Gets the bytes of this instruction. First byte in array is its opcode.

Overrides:
getBytes in class Instruction
Returns:
bytes of this instruction.

getDefault

public Instruction getDefault()
Get the default Instruction of this SwitchInstruction. Default instruction is the one used, when keys do not match.

Returns:
default Instruction of this SwitchInstruction

getTargets

public SwitchInstruction.Target[] getTargets()
Gets all the targets of this SwitchInstruction. Target encapsulates target Instruction, and its associated key.

Returns:
an array of Targets.

toString

public java.lang.String toString()
Overrides:
toString in class Instruction


Copyright © 2001. Documenation generated August 26 2011.