Package org.apache.bcel.classfile
Class LineNumber
java.lang.Object
org.apache.bcel.classfile.LineNumber
This class represents a (PC offset, line number) pair, i.e., a line number in
the source that corresponds to a relative address in the byte code. This
is used for debugging purposes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate short
number in source fileprivate short
Program Counter (PC) corresponds to line -
Constructor Summary
ConstructorsConstructorDescriptionLineNumber
(int start_pc, int line_number) LineNumber
(DataInput file) Construct object from file stream.Initialize from another object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.copy()
void
dump
(DataOutputStream file) Dump line number/pc pair to file stream in binary format.int
int
void
setLineNumber
(int line_number) void
setStartPC
(int start_pc) toString()
-
Field Details
-
start_pc
private short start_pcProgram Counter (PC) corresponds to line -
line_number
private short line_numbernumber in source file
-
-
Constructor Details
-
LineNumber
Initialize from another object.- Parameters:
c
- the object to copy
-
LineNumber
LineNumber(DataInput file) throws IOException Construct object from file stream.- Parameters:
file
- Input stream- Throws:
IOException
- if an I/O Exception occurs in readUnsignedShort
-
LineNumber
public LineNumber(int start_pc, int line_number) - Parameters:
start_pc
- Program Counter (PC) corresponds toline_number
- line number in source file
-
-
Method Details
-
accept
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. -
dump
Dump line number/pc pair to file stream in binary format.- Parameters:
file
- Output file stream- Throws:
IOException
- if an I/O Exception occurs in writeShort
-
getLineNumber
public int getLineNumber()- Returns:
- Corresponding source line
-
getStartPC
public int getStartPC()- Returns:
- PC in code
-
setLineNumber
public void setLineNumber(int line_number) - Parameters:
line_number
- the source line number
-
setStartPC
public void setStartPC(int start_pc) - Parameters:
start_pc
- the pc for this line number
-
toString
-
copy
- Returns:
- deep copy of this object
-