org.apache.bcel.generic

Class LineNumberGen

public class LineNumberGen extends Object implements InstructionTargeter, Cloneable, Serializable

This class represents a line number within a method, i.e., give an instruction a line number corresponding to the source code line.

See Also: LineNumber MethodGen

Constructor Summary
LineNumberGen(InstructionHandle ih, int src_line)
Create a line number.
Method Summary
Objectclone()
booleancontainsTarget(InstructionHandle ih)
InstructionHandlegetInstruction()
LineNumbergetLineNumber()
Get LineNumber attribute .
intgetSourceLine()
voidsetInstruction(InstructionHandle ih)
voidsetSourceLine(int src_line)
voidupdateTarget(InstructionHandle old_ih, InstructionHandle new_ih)

Constructor Detail

LineNumberGen

public LineNumberGen(InstructionHandle ih, int src_line)
Create a line number.

Parameters: ih instruction handle to reference

Method Detail

clone

public Object clone()

containsTarget

public boolean containsTarget(InstructionHandle ih)

Returns: true, if ih is target of this line number

getInstruction

public InstructionHandle getInstruction()

getLineNumber

public LineNumber getLineNumber()
Get LineNumber attribute . This relies on that the instruction list has already been dumped to byte code or or that the `setPositions' methods has been called for the instruction list.

getSourceLine

public int getSourceLine()

setInstruction

public void setInstruction(InstructionHandle ih)

setSourceLine

public void setSourceLine(int src_line)

updateTarget

public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)

Parameters: old_ih old target new_ih new target