//Copyright 2006-2007 Acelet Corporation. All rights reserved.
package limpidlog.asm1;
import limpidlog.org.objectweb.asm.Label;
import limpidlog.lib.BytecodeUtil;
import limpidlog.log.Common;
/**
* @author Wei Jiang
*/
public class LocalVariable implements Comparable {
public String name;
public String desc;
public String signature;
public Label start;
public Label end;
public int index;
public int startOffset;
public int endOffset;
public int opcode;
public String functionDesc;
LocalVariable(String name, String desc, String signature, Label start, Label end, int index) {
this.name = name;
this.desc = desc;
this.signature = signature;
this.start = start;
this.end = end;
this.index = index;
startOffset = start.getOffset();
endOffset = end.getOffset();
}
public int compareTo(Object otherObject) {
LocalVariable other = (LocalVariable) otherObject;
return index - other.index;
}
public void init() {
opcode = new BytecodeUtil().makeLoadOpcode(desc);
functionDesc = new Common().makeFunctionDesc(desc);
}
public String toString() {
return index + "," + name + "," + startOffset + "," + endOffset;
}
}