|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vladium.jcd.cls.attribute.Attribute_info
com.vladium.jcd.cls.attribute.LineNumberTableAttribute_info
public final class LineNumberTableAttribute_info
The LineNumberTable attribute is an optional variable-length attribute in
the attributes table of a CodeAttribute_info attribute. It may be
used by debuggers to determine which part of the JVM code array corresponds
to a given line number in the original source file. If LineNumberTable
attributes are present in the attributes table of a given Code attribute,
then they may appear in any order. Furthermore, multiple LineNumberTable
attributes may together represent a given line of a source file; that is,
LineNumberTable attributes need not be one-to-one with source lines.
The LineNumberTable attribute has the following format:
LineNumberTable_attribute {
u2 attribute_name_index;
u4 attribute_length;
u2 line_number_table_length;
{ u2 start_pc;
u2 line_number;
} line_number_table[line_number_table_length];
}
LineNumberTable_attribute structure contains the following items:
line_number_table_length
The value of the line_number_table_length item indicates the number of
entries in the line_number_table array.
line_number_table[]
Each entry in the line_number_table array indicates that the line number
in the original source file changes at a given point in the code array.
Each line_number_table entry must contain the following two items:
start_pc
The value of the start_pc item must indicate the index into the code array
at which the code for a new line in the original source file begins. The
value of start_pc must be less than the value of the code_length item of
the CodeAttribute_info attribute of which this LineNumberTable
is an attribute.
line_number
The value of the line_number item must give the corresponding line number
in the original source file.
| Field Summary | |
|---|---|
private java.util.List |
m_lines
|
| Fields inherited from class com.vladium.jcd.cls.attribute.Attribute_info |
|---|
ATTRIBUTE_BRIDGE, ATTRIBUTE_CODE, ATTRIBUTE_CONSTANT_VALUE, ATTRIBUTE_EXCEPTIONS, ATTRIBUTE_INNERCLASSES, ATTRIBUTE_LINE_NUMBER_TABLE, ATTRIBUTE_SOURCEFILE, ATTRIBUTE_SYNTHETIC, m_attribute_length, m_name_index |
| Constructor Summary | |
|---|---|
LineNumberTableAttribute_info(int attribute_name_index,
long attribute_length,
UDataInputStream bytes)
|
|
| Method Summary | |
|---|---|
void |
accept(IAttributeVisitor visitor,
java.lang.Object ctx)
|
java.lang.Object |
clone()
Performs a deep copy. |
LineNumber_info |
get(int offset)
Returns LineNumber_info descriptor at a given offset. |
long |
length()
Returns the total length of this attribute when converted to .class format [including the 6-byte header] |
int |
size()
Returns the number of descriptors in this collection [can be 0]. |
java.lang.String |
toString()
|
void |
writeInClassFormat(UDataOutputStream out)
|
| Methods inherited from class com.vladium.jcd.cls.attribute.Attribute_info |
|---|
getName, new_Attribute_info |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.util.List m_lines
| Constructor Detail |
|---|
LineNumberTableAttribute_info(int attribute_name_index,
long attribute_length,
UDataInputStream bytes)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public LineNumber_info get(int offset)
LineNumber_info descriptor at a given offset.
offset - line number entry offset [must be in [0, size()) range;
input not checked]
java.lang.IndexOutOfBoundsException - if 'offset' is outside of valid rangepublic int size()
public long length()
Attribute_info
length in class Attribute_info
public void accept(IAttributeVisitor visitor,
java.lang.Object ctx)
accept in class Attribute_infopublic java.lang.String toString()
toString in class Attribute_infopublic java.lang.Object clone()
clone in class Attribute_info
public void writeInClassFormat(UDataOutputStream out)
throws java.io.IOException
writeInClassFormat in interface IClassFormatOutputwriteInClassFormat in class Attribute_infojava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||