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.List ; 42 import java.util.ArrayList ; 43 import java.util.Arrays ; 44 45 48 49 public class LookupSwitchInsnNode extends AbstractInsnNode { 50 51 54 55 public Label dflt; 56 57 61 62 public final List keys; 63 64 68 69 public final List labels; 70 71 79 80 public LookupSwitchInsnNode ( 81 final Label dflt, 82 final int[] keys, 83 final Label[] labels) 84 { 85 super(Constants.LOOKUPSWITCH); 86 this.dflt = dflt; 87 this.keys = new ArrayList (); 88 this.labels = new ArrayList (); 89 if (keys != null) { 90 for (int i = 0; i < keys.length; ++i) { 91 this.keys.add(new Integer (keys[i])); 92 } 93 } 94 if (labels != null) { 95 this.labels.addAll(Arrays.asList(labels)); 96 } 97 } 98 99 public void accept (final CodeVisitor cv) { 100 int[] keys = new int[this.keys.size()]; 101 for (int i = 0; i < keys.length; ++i) { 102 keys[i] = ((Integer )this.keys.get(i)).intValue(); 103 } 104 Label[] labels = new Label[this.labels.size()]; 105 this.labels.toArray(labels); 106 cv.visitLookupSwitchInsn(dflt, keys, labels); 107 } 108 } 109 | Popular Tags |