Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.classfile

public final Class LineNumber

extends Object
implements Cloneable, Node
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.bcel.internal.classfile.Node, java.lang.Cloneable
Imports
java.io.DataInput, .DataOutputStream, .IOException, com.sun.org.apache.bcel.internal.util.Args

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
LineNumberTable

Field Summary

Modifier and TypeField and Description
pack-priv static final LineNumber[]
private int
lineNumber

number in source file

private int
startPc

Program Counter (PC) corresponds to line

Constructor Summary

AccessConstructor and Description
pack-priv
LineNumber(final DataInput
Input stream
file
)

Construct object from file stream.

public
LineNumber(final int
Program Counter (PC) corresponds to
startPc
,
final int
line number in source file
lineNumber
)

public
LineNumber(final LineNumber
the object to copy
c
)

Initialize from another object.

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements com.sun.org.apache.bcel.internal.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.

public LineNumber

Returns:

deep copy of this object
copy
()

public void
dump(final DataOutputStream
Output file stream
file
)

Dump line number/pc pair to file stream in binary format.

public int

Returns:

Corresponding source line
getLineNumber
()

public int

Returns:

PC in code
getStartPC
()

public void
setLineNumber(final int
the source line number
lineNumber
)

public void
setStartPC(final int
the pc for this line number
startPc
)

public String

Returns:

String representation
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

EMPTY_ARRAYback to summary
pack-priv static final LineNumber[] EMPTY_ARRAY
lineNumberback to summary
private int lineNumber

number in source file

startPcback to summary
private int startPc

Program Counter (PC) corresponds to line

Constructor Detail

LineNumberback to summary
pack-priv LineNumber(final DataInput file) throws IOException

Construct object from file stream.

Parameters
file:DataInput

Input stream

Exceptions
IOException:
if an I/O Exception occurs in readUnsignedShort
LineNumberback to summary
public LineNumber(final int startPc, final int lineNumber)
Parameters
startPc:int

Program Counter (PC) corresponds to

lineNumber:int

line number in source file

LineNumberback to summary
public LineNumber(final LineNumber c)

Initialize from another object.

Parameters
c:LineNumber

the object to copy

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements com.sun.org.apache.bcel.internal.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly 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

Visitor object

Annotations
@Override
copyback to summary
public LineNumber copy()
Returns:LineNumber

deep copy of this object

dumpback to summary
public void dump(final DataOutputStream file) throws IOException

Dump line number/pc pair to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Exceptions
IOException:
if an I/O Exception occurs in writeShort
getLineNumberback to summary
public int getLineNumber()
Returns:int

Corresponding source line

getStartPCback to summary
public int getStartPC()
Returns:int

PC in code

setLineNumberback to summary
public void setLineNumber(final int lineNumber)
Parameters
lineNumber:int

the source line number

setStartPCback to summary
public void setStartPC(final int startPc)
Parameters
startPc:int

the pc for this line number

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

String representation

Annotations
@Override