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

LineNumberTableAttribute

public class LineNumberTableAttribute extends ClassAttribute
LineNumberTableAttribute represents a line number table attribute within a CodeAttribute within a class file

Fields Summary
public static final String
expectedAttrName
private short[]
lineNumbers
private InsnTarget[]
targets
Constructors Summary
public LineNumberTableAttribute(ConstUtf8 nameAttr, short[] lineNums, InsnTarget[] targets)
Constructor


  /* public accessors */

      
   
	      
    super(nameAttr);
    lineNumbers = lineNums;
    this.targets = targets;
  
Methods Summary
voidprint(java.io.PrintStream out, int indent)

    ClassPrint.spaces(out, indent);
    out.println("Line Numbers: ");//NOI18N
    for (int i=0; i<lineNumbers.length; i++) {
      ClassPrint.spaces(out, indent+2);
      out.println(Integer.toString(lineNumbers[i]) + " @ " +//NOI18N
                 Integer.toString(targets[i].offset()));
    }
  
static com.sun.jdo.api.persistence.enhancer.classfile.LineNumberTableAttributeread(ConstUtf8 attrName, java.io.DataInputStream data, CodeEnv env)

    int nLnums = data.readUnsignedShort();
    short lineNums[] = new short[nLnums];
    InsnTarget targs[] = new InsnTarget[nLnums];
    for (int i=0; i<nLnums; i++) {
      targs[i] = env.getTarget(data.readShort());
      lineNums[i] = data.readShort();
    }
    return  new LineNumberTableAttribute(attrName, lineNums, targs);
  
voidwrite(java.io.DataOutputStream out)

    out.writeShort(attrName().getIndex());
    int nlines = lineNumbers.length;
    out.writeInt(2+4*nlines);
    out.writeShort(nlines);
    for (int i=0; i<nlines; i++) {
      out.writeShort(targets[i].offset());
      out.writeShort(lineNumbers[i]);
    }