Top Description Fields Constructors Methods
org.aspectj.apache.bcel.classfile

public final Class LineNumberTable

extends Attribute
Class Inheritance
Imports
java.io.ByteArrayInputStream, .DataInputStream, .DataOutputStream, .IOException, org.aspectj.apache.bcel.Constants

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.
Author
M. Dahm
Version
$Id: LineNumberTable.java,v 1.8 2009/09/15 19:40:12 aclement Exp $
See Also
changes: asc Feb06 Made unpacking lazy

Field Summary

Modifier and TypeField and Description
private byte[]
private boolean
private LineNumber[]
private int
Inherited from org.aspectj.apache.bcel.classfile.Attribute:
cpoollengthnameIndexNoAttributestag

Constructor Summary

AccessConstructor and Description
public
public
LineNumberTable(int nameIndex, int length, LineNumber[] lineNumberTable, ConstantPool constantPool)

pack-priv
LineNumberTable(int
Index of name
name_index
,
int
Content length in bytes
length
,
DataInputStream
Input stream
file
,
ConstantPool
Array of constants
constant_pool
)

Construct object from file stream.

Method Summary

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

Implements abstract org.aspectj.apache.bcel.classfile.Attribute.accept.

Implements org.aspectj.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
public final void
dump(DataOutputStream
Output file stream
file
)

Overrides org.aspectj.apache.bcel.classfile.Attribute.dump.

Dump line number table attribute to file stream in binary format.
public final LineNumber[]

Returns:

Array of (pc offset, line number) pairs.
getLineNumberTable
()

public int

Returns:

corresponding line in source code
getSourceLine
(int
byte code offset
pos
)

Map byte code positions to source code lines.

public final int

Returns:

deep copy of this attribute
getTableLength
()

public final void
setLineNumberTable(LineNumber[] line_number_table)

public final String

Returns:

String representation.
toString
()

Overrides org.aspectj.apache.bcel.classfile.Attribute.toString.

Returns a string representation of the object.
private void
Inherited from org.aspectj.apache.bcel.classfile.Attribute:
getConstantPoolgetLengthgetNamegetNameIndexgetTagreadAttribute

Field Detail

databack to summary
private byte[] data
isInPackedStateback to summary
private boolean isInPackedState
tableback to summary
private LineNumber[] table
tableLengthback to summary
private int tableLength

Constructor Detail

LineNumberTableback to summary
public LineNumberTable(LineNumberTable c)
LineNumberTableback to summary
public LineNumberTable(int nameIndex, int length, LineNumber[] lineNumberTable, ConstantPool constantPool)
LineNumberTableback to summary
pack-priv LineNumberTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException

Construct object from file stream.

Parameters
name_index:int

Index of name

length:int

Content length in bytes

file:DataInputStream

Input stream

constant_pool:ConstantPool

Array of constants

Method Detail

acceptback to summary
public void accept(ClassVisitor v)

Implements abstract org.aspectj.apache.bcel.classfile.Attribute.accept.

Implements org.aspectj.apache.bcel.classfile.Node.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.

Parameters
v:ClassVisitor

Visitor object

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

Overrides org.aspectj.apache.bcel.classfile.Attribute.dump.

Dump line number table attribute to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
getLineNumberTableback to summary
public final LineNumber[] getLineNumberTable()
Returns:LineNumber[]

Array of (pc offset, line number) pairs.

getSourceLineback to summary
public int getSourceLine(int pos)

Map byte code positions to source code lines.

Parameters
pos:int

byte code offset

Returns:int

corresponding line in source code

getTableLengthback to summary
public final int getTableLength()
Returns:int

deep copy of this attribute

setLineNumberTableback to summary
public final void setLineNumberTable(LineNumber[] line_number_table)
toStringback to summary
public final String toString()

Overrides org.aspectj.apache.bcel.classfile.Attribute.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

String representation.

Annotations
@Override
unpackback to summary
private void unpack()