org.apache.bcel.classfile

Class LineNumberTable

public final class LineNumberTable extends Attribute

This class represents a table of line numbers for debugging purposes. This attribute is used by the Code attribute. It contains pairs of PCs and line numbers.

See Also: Code LineNumber

Constructor Summary
LineNumberTable(LineNumberTable c)
LineNumberTable(int name_index, int length, LineNumber[] line_number_table, ConstantPool constant_pool)
Method Summary
voidaccept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
Attributecopy(ConstantPool _constant_pool)
voiddump(DataOutputStream file)
Dump line number table attribute to file stream in binary format.
LineNumber[]getLineNumberTable()
intgetSourceLine(int pos)
Map byte code positions to source code lines.
intgetTableLength()
voidsetLineNumberTable(LineNumber[] line_number_table)
StringtoString()

Constructor Detail

LineNumberTable

public LineNumberTable(LineNumberTable c)

LineNumberTable

public LineNumberTable(int name_index, int length, LineNumber[] line_number_table, ConstantPool constant_pool)

Method Detail

accept

public void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters: v Visitor object

copy

public Attribute copy(ConstantPool _constant_pool)

Returns: deep copy of this attribute

dump

public final void dump(DataOutputStream file)
Dump line number table attribute to file stream in binary format.

Parameters: file Output file stream

Throws: IOException

getLineNumberTable

public final LineNumber[] getLineNumberTable()

Returns: Array of (pc offset, line number) pairs.

getSourceLine

public int getSourceLine(int pos)
Map byte code positions to source code lines.

Parameters: pos byte code offset

Returns: corresponding line in source code

getTableLength

public final int getTableLength()

setLineNumberTable

public final void setLineNumberTable(LineNumber[] line_number_table)

Parameters: line_number_table the line number entries for this table

toString

public final String toString()

Returns: String representation.