All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.fub.bytecode.generic.SWITCH

java.lang.Object
   |
   +----de.fub.bytecode.generic.SWITCH

public final class SWITCH
extends Object
implements CompoundInstruction
SWITCH - Branch depending on int value, generates either LOOKUPSWITCH or TABLESWITCH instruction, depending on whether the match values (int[]) can be sorted with no gaps between the numbers.

Version:
$Id: SWITCH.java,v 1.3 1999/05/04 13:14:54 dahm Exp $
Author:
M. Dahm

Constructor Index

 o SWITCH(int[], InstructionHandle[], InstructionHandle)
 o SWITCH(int[], InstructionHandle[], InstructionHandle, int)
Template for switch() constructs.

Method Index

 o getInstruction()
 o getInstructionList()

Constructors

 o SWITCH
 public SWITCH(int match[],
               InstructionHandle targets[],
               InstructionHandle target,
               int max_gap)
Template for switch() constructs. If the match array can be sorted in ascending order with gaps no larger than max_gap between the numbers, a TABLESWITCH instruction is generated, and a LOOKUPSWITCH otherwise. The former may be more efficient, but needs more space. Note, that the key array always will be sorted, though we leave the original arrays unaltered.

Parameters:
match - array of match values (case 2: ... case 7: ..., etc.)
targets - the instructions to be branched to for each case
target - the default target
max_gap - maximum gap that may between case branches
 o SWITCH
 public SWITCH(int match[],
               InstructionHandle targets[],
               InstructionHandle target)

Methods

 o getInstructionList
 public final InstructionList getInstructionList()
 o getInstruction
 public final Instruction getInstruction()

All Packages  Class Hierarchy  This Package  Previous  Next  Index