jellyj.classfile.javaclass
Class LineNumber


public final class 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.

Author:
JellyJ Design Group
See Also: LineNumberTable

Constructor Summary
 LineNumber()
          Empty constructor, all attributes have to be defined via `setXXX' methods.
 LineNumber(LineNumber c)
          Initialize from another object.
 (package private) LineNumber(DataInputStream file)
          Construct object from file stream.
 LineNumber(int start_pc, int line_number)
           

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.
 final voiddump(DataOutputStream file)
          Dump line number/pc pair to file stream in binary format.
 final intgetLineNumber()
           
 final intgetStartPC()
           
 final voidsetLineNumber(int line_number)
           
 final voidsetStartPC(int start_pc)
           
 final StringtoString()
           

Constructor Detail

LineNumber

public LineNumber()
Empty constructor, all attributes have to be defined via `setXXX' methods. Use at your own risk.

LineNumber

public LineNumber(LineNumber c)
Initialize from another object.

LineNumber

LineNumber(DataInputStream file)
throws java.io.IOException
Construct object from file stream.
Parameters:
file - Input stream
throw IOException

LineNumber

public LineNumber(int start_pc, int line_number)
Parameters:
start_pc - Program Counter (PC) corresponds to
line_number - line number in source file
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

dump

public final void dump(DataOutputStream file)
throws java.io.IOException
Dump line number/pc pair to file stream in binary format.
Parameters:
file - Output file stream
throw IOException

getLineNumber

public final int getLineNumber()
Returns: Corresponding source line

getStartPC

public final int getStartPC()
Returns: PC in code

setLineNumber

public final void setLineNumber(int line_number)
Parameters:
line_number.

setStartPC

public final void setStartPC(int start_pc)
Parameters:
start_pc.

toString

public final String toString()
Returns: String representation