public final class LineNumberTableAttribute_info extends Attribute_info
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_lengthThe 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_pcThe 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 theCodeAttribute_info
attribute of which this LineNumberTable is an attribute.
line_numberThe value of the line_number item must give the corresponding line number in the original source file.
Modifier and Type | Field and Description |
---|---|
private java.util.List |
m_lines |
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 and Description |
---|
LineNumberTableAttribute_info(int attribute_name_index,
long attribute_length,
UDataInputStream bytes) |
Modifier and Type | Method and Description |
---|---|
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) |
getName, new_Attribute_info
LineNumberTableAttribute_info(int attribute_name_index, long attribute_length, UDataInputStream bytes) throws java.io.IOException
java.io.IOException
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_info
public java.lang.String toString()
toString
in class Attribute_info
public java.lang.Object clone()
clone
in class Attribute_info
public void writeInClassFormat(UDataOutputStream out) throws java.io.IOException
writeInClassFormat
in interface IClassFormatOutput
writeInClassFormat
in class Attribute_info
java.io.IOException