FileDocCategorySizeDatePackage
LocalVariable.javaAPI DocGlassfish v2 API4347Fri May 04 22:34:28 BST 2007com.sun.jdo.api.persistence.enhancer.classfile

LocalVariable

public class LocalVariable extends Object
Represents a local variable within a LocalVariableTable within a CodeAttribute in a class file.

Fields Summary
private InsnTarget
varStartPC
private InsnTarget
varEndPC
private ConstUtf8
varName
private ConstUtf8
varSig
private int
varSlot
Constructors Summary
public LocalVariable(InsnTarget startPC, InsnTarget endPC, ConstUtf8 name, ConstUtf8 sig, int slot)
Constructor for a local variable

    varStartPC = startPC;
    varEndPC = endPC;
    varName = name;
    varSig = sig;
    varSlot = slot;
  
Methods Summary
public voidprint(java.io.PrintStream out, int indent)

    ClassPrint.spaces(out, indent);
    out.print("'" + ((varName == null) ? "(null)" : varName.asString()) + "'");//NOI18N
    out.print(" sig = " + ((varSig == null) ? "(null)" : varSig.asString()));//NOI18N
    out.print(" start_pc = " + Integer.toString(varStartPC.offset()));//NOI18N
    out.print(" length = " +//NOI18N
	     Integer.toString(varEndPC.offset() - varStartPC.offset()));
    out.println(" slot = " + Integer.toString(varSlot));//NOI18N
  
static com.sun.jdo.api.persistence.enhancer.classfile.LocalVariableread(java.io.DataInputStream data, CodeEnv env)

    int startPC = data.readUnsignedShort();
    InsnTarget startPCTarget = env.getTarget(startPC);
    int length = data.readUnsignedShort();
    InsnTarget endPCTarget = env.getTarget(startPC+length);
    ConstUtf8 name = 
      (ConstUtf8) env.pool().constantAt(data.readUnsignedShort());
    ConstUtf8 sig = 
      (ConstUtf8) env.pool().constantAt(data.readUnsignedShort());
    int slot = data.readUnsignedShort();
    return new LocalVariable(startPCTarget, endPCTarget, name, sig, slot);
  
voidwrite(java.io.DataOutputStream out)

    out.writeShort(varStartPC.offset());
    out.writeShort(varEndPC.offset() - varStartPC.offset());
    out.writeShort((varName == null) ? 0 : varName.getIndex());
    out.writeShort((varSig == null) ? 0 : varSig.getIndex());
    out.writeShort(varSlot);