1 34 35 package org.logicalcobwebs.asm.tree; 36 37 import org.logicalcobwebs.asm.Label; 38 import org.logicalcobwebs.asm.Constants; 39 import org.logicalcobwebs.asm.CodeVisitor; 40 41 import java.util.ArrayList ; 42 import java.util.Arrays ; 43 import java.util.List ; 44 45 48 49 public class TableSwitchInsnNode extends AbstractInsnNode { 50 51 54 55 public int min; 56 57 60 61 public int max; 62 63 66 67 public Label dflt; 68 69 73 74 public final List labels; 75 76 85 86 public TableSwitchInsnNode ( 87 final int min, 88 final int max, 89 final Label dflt, 90 final Label[] labels) 91 { 92 super(Constants.TABLESWITCH); 93 this.min = min; 94 this.max = max; 95 this.dflt = dflt; 96 this.labels = new ArrayList (); 97 if (labels != null) { 98 this.labels.addAll(Arrays.asList(labels)); 99 } 100 } 101 102 public void accept (final CodeVisitor cv) { 103 Label[] labels = new Label[this.labels.size()]; 104 this.labels.toArray(labels); 105 cv.visitTableSwitchInsn(min, max, dflt, labels); 106 } 107 } 108 | Popular Tags |