harpoon.IR.RawClass
Class AttributeLineNumberTable

java.lang.Object
  extended by harpoon.IR.RawClass.Attribute
      extended by harpoon.IR.RawClass.AttributeLineNumberTable

public class AttributeLineNumberTable
extends Attribute

The LineNumberTable attribute is an optional variable-length attribute in the attributes table of a Code attribute. It may be used by debuggers to determine which part of the Java Virtual Machine code array corresponds to a given line number in the original Java 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 Java source file; that is, LineNumberTable attributes need not be one-to-one with source lines.

Version:
$Id: AttributeLineNumberTable.java,v 1.3 2003/09/05 21:45:16 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
"The Java Virtual Machine Specification, section 4.7.6", AttributeCode, Attribute

Field Summary
static String ATTRIBUTE_NAME
          The string naming this Attribute type.
 LineNumberTable[] line_number_table
          Each entry in the line_number_table array indicates that the line number in the original Java source file changes at a given point in the code array.
 
Fields inherited from class harpoon.IR.RawClass.Attribute
attribute_name_index, parent
 
Constructor Summary
AttributeLineNumberTable(ClassFile parent, int attribute_name_index, LineNumberTable[] line_number_table)
          Constructor.
 
Method Summary
 long attribute_length()
          The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
 int line_number_table_length()
           
 void print(PrintWriter pw, int indent)
          Pretty-print this attribute.
 void write(ClassDataOutputStream out)
          Write to bytecode stream.
 
Methods inherited from class harpoon.IR.RawClass.Attribute
attribute_name_index, attribute_name, read, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_NAME

public static final String ATTRIBUTE_NAME
The string naming this Attribute type.

See Also:
Constant Field Values

line_number_table

public LineNumberTable[] line_number_table
Each entry in the line_number_table array indicates that the line number in the original Java source file changes at a given point in the code array.

Constructor Detail

AttributeLineNumberTable

public AttributeLineNumberTable(ClassFile parent,
                                int attribute_name_index,
                                LineNumberTable[] line_number_table)
Constructor.

Method Detail

attribute_length

public long attribute_length()
Description copied from class: Attribute
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.

Specified by:
attribute_length in class Attribute

line_number_table_length

public int line_number_table_length()

write

public void write(ClassDataOutputStream out)
           throws IOException
Write to bytecode stream.

Specified by:
write in class Attribute
Throws:
IOException

print

public void print(PrintWriter pw,
                  int indent)
Pretty-print this attribute.

Overrides:
print in class Attribute
Parameters:
indent - the indentation level to use.