All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zving.framework.thirdparty.asm.tree.TableSwitchInsnNode Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
package com.zving.framework.thirdparty.asm.tree;

import com.zving.framework.thirdparty.asm.Label;
import com.zving.framework.thirdparty.asm.MethodVisitor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

public class TableSwitchInsnNode
  extends AbstractInsnNode
{
  public List labels;
  public int min;
  public int max;
  public LabelNode dflt;
  
  public TableSwitchInsnNode(int min, int max, LabelNode dflt, LabelNode... labels)
  {
    super(170);
    this.min = min;
    this.max = max;
    this.dflt = dflt;
    this.labels = new ArrayList();
    if (labels != null) {
      this.labels.addAll(Arrays.asList(labels));
    }
  }
  
  public int getType()
  {
    return 11;
  }
  
  public void accept(MethodVisitor mv)
  {
    Label[] labels = new Label[this.labels.size()];
    for (int i = 0; i < labels.length; i++) {
      labels[i] = ((LabelNode)this.labels.get(i)).getLabel();
    }
    mv.visitTableSwitchInsn(this.min, this.max, this.dflt.getLabel(), labels);
  }
  
  public AbstractInsnNode clone(Map labels)
  {
    return new TableSwitchInsnNode(this.min, this.max, clone(this.dflt, labels), clone(this.labels, labels));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy