1 30 package org.objectweb.asm.tree; 31 32 import org.objectweb.asm.Label; 33 import org.objectweb.asm.Opcodes; 34 import org.objectweb.asm.MethodVisitor; 35 36 import java.util.ArrayList ; 37 import java.util.Arrays ; 38 import java.util.List ; 39 40 45 public class TableSwitchInsnNode extends AbstractInsnNode { 46 47 50 public int min; 51 52 55 public int max; 56 57 60 public Label dflt; 61 62 66 public final List labels; 67 68 77 public TableSwitchInsnNode( 78 final int min, 79 final int max, 80 final Label dflt, 81 final Label[] labels) 82 { 83 super(Opcodes.TABLESWITCH); 84 this.min = min; 85 this.max = max; 86 this.dflt = dflt; 87 this.labels = new ArrayList (); 88 if (labels != null) { 89 this.labels.addAll(Arrays.asList(labels)); 90 } 91 } 92 93 public void accept(final MethodVisitor mv) { 94 Label[] labels = new Label[this.labels.size()]; 95 this.labels.toArray(labels); 96 mv.visitTableSwitchInsn(min, max, dflt, labels); 97 } 98 99 public int getType() { 100 return TABLESWITCH_INSN; 101 } 102 } | Popular Tags |