All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.IR.Bytecode.InSwitch

java.lang.Object
   |
   +----harpoon.IR.Bytecode.Instr
           |
           +----harpoon.IR.Bytecode.InCti
                   |
                   +----harpoon.IR.Bytecode.InSwitch

public class InSwitch
extends InCti
InSwitch is used for the tableswitch and lookupswitch java bytecode instructions. It is a control-transfer instruction. It should have exactly one predecessor. The first successor will be the default target; each subsequent successor corresponds to a case of the switch statement; the match key can be looked up using the key method.

Version:
$Id: InSwitch.java,v 1.2 1998/10/11 03:01:16 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Instr

Constructor Index

 o InSwitch(String, int, byte[], int)
Constructor.

Method Index

 o key(int)
Returns the case key corresponding to the given branch target index.

InSwitch.key(n) corresponds to InSwitch.next()[n] for 0.

 o toString()
Return human-readable instruction string.

Constructors

 o InSwitch
 public InSwitch(String sourcefile,
                 int linenumber,
                 byte code[],
                 int pc)
Constructor. Creates an InSwitch from a chunk of bytecode starting at the given pc.

Throws: Error
if the opcode at code[pc] doesn't correspond to a tableswitch or lookupswitch.

Methods

 o key
 public int key(int index)
Returns the case key corresponding to the given branch target index.

InSwitch.key(n) corresponds to InSwitch.next()[n] for 0.

Throws: Error
if the default target or an instruction not corresponding to a target is given.
 o toString
 public String toString()
Return human-readable instruction string.

Overrides:
toString in class InCti

All Packages  Class Hierarchy  This Package  Previous  Next  Index