Methods Summary |
---|
public java.lang.Object | clone()
try {
return super.clone();
} catch(CloneNotSupportedException e) {
System.err.println(e);
return null;
}
|
public boolean | containsTarget(com.sun.org.apache.bcel.internal.generic.InstructionHandle ih)
return (start == ih) || (end == ih);
|
public boolean | equals(java.lang.Object o)We consider to local variables to be equal, if the use the same index and
are valid in the same range.
if(!(o instanceof LocalVariableGen))
return false;
LocalVariableGen l = (LocalVariableGen)o;
return (l.index == index) && (l.start == start) && (l.end == end);
|
public com.sun.org.apache.bcel.internal.generic.InstructionHandle | getEnd() return end;
|
public int | getIndex() return index;
|
public com.sun.org.apache.bcel.internal.classfile.LocalVariable | getLocalVariable(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cp)Get LocalVariable object.
This relies on that the instruction list has already been dumped to byte code or
or that the `setPositions' methods has been called for the instruction list.
int start_pc = start.getPosition();
int length = end.getPosition() - start_pc;
int name_index = cp.addUtf8(name);
int signature_index = cp.addUtf8(type.getSignature());
return new LocalVariable(start_pc, length, name_index,
signature_index, index, cp.getConstantPool());
|
public java.lang.String | getName() return name;
|
public com.sun.org.apache.bcel.internal.generic.InstructionHandle | getStart() return start;
|
public com.sun.org.apache.bcel.internal.generic.Type | getType() return type;
|
public void | setEnd(com.sun.org.apache.bcel.internal.generic.InstructionHandle end)
BranchInstruction.notifyTarget(this.end, end, this);
this.end = end;
|
public void | setIndex(int index) this.index = index;
|
public void | setName(java.lang.String name) this.name = name;
|
public void | setStart(com.sun.org.apache.bcel.internal.generic.InstructionHandle start)
BranchInstruction.notifyTarget(this.start, start, this);
this.start = start;
|
public void | setType(com.sun.org.apache.bcel.internal.generic.Type type) this.type = type;
|
public java.lang.String | toString()
return "LocalVariableGen(" + name + ", " + type + ", " + start + ", " + end + ")";
|
public void | updateTarget(com.sun.org.apache.bcel.internal.generic.InstructionHandle old_ih, com.sun.org.apache.bcel.internal.generic.InstructionHandle new_ih)
boolean targeted = false;
if(start == old_ih) {
targeted = true;
setStart(new_ih);
}
if(end == old_ih) {
targeted = true;
setEnd(new_ih);
}
if(!targeted)
throw new ClassGenException("Not targeting " + old_ih + ", but {" + start + ", " +
end + "}");
|