Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.bcel.classfile
Class LineNumber

    java.lang.Object
      |
      +--org.apache.bcel.classfile.LineNumber

All Implemented Interfaces:
  java.lang.Cloneable, Node, java.io.Serializable

public final class LineNumber
extends java.lang.Object
implements java.lang.Cloneable, Node, java.io.Serializable

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.

Version:
  $Id: LineNumber.java,v 1.3 2002/07/11 19:39:04 mdahm Exp $
Author:
  M. Dahm
See Also:
  `LineNumberTable`, Serialized Form

Constructor Summary
`LineNumber(int start_pc, int line_number)`
`LineNumber(LineNumber c)` Initialize from another object.

Method Summary
`void` | `accept(Visitor v)` Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
`LineNumber` | `copy()`
`void` | `dump(java.io.DataOutputStream file)` Dump line number/pc pair to file stream in binary format.
`int` | `getLineNumber()`
`int` | `getStartPC()`
`void` | `setLineNumber(int line_number)`
`void` | `setStartPC(int start_pc)`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### LineNumber

    public LineNumber(LineNumber c)

  Initialize from another object.

### 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.

  Specified by:
    `accept` in interface `Node`
  Parameters:
    `v` - Visitor object

### dump

    public final void dump(java.io.DataOutputStream file)
                    throws java.io.IOException

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

  Parameters:
    `file` - Output file stream
  Throws:
    `java.io.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)

### setStartPC

    public final void setStartPC(int start_pc)

### toString

    public final java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    String representation

### copy

    public LineNumber copy()

  Returns:
    deep copy of this object

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2003 Apache Software Foundation. All Rights Reserved.