LineNumberTableAttributepublic 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 |
---|
void | print(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.LineNumberTableAttribute | read(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);
| void | write(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]);
}
|
|