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

public Class LineNumberGen

extends Object
implements InstructionTargeter, Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable, org.aspectj.apache.bcel.generic.InstructionTargeter
Imports
org.aspectj.apache.bcel.classfile.LineNumber

This class represents a line number within a method, i.e., give an instruction a line number corresponding to the source code line.
Author
M. Dahm
Version
$Id: LineNumberGen.java,v 1.5 2008/05/28 23:53:00 aclement Exp $
See Also
LineNumber, MethodGen

Field Summary

Modifier and TypeField and Description
private InstructionHandle
private int

Constructor Summary

AccessConstructor and Description
public
LineNumberGen(InstructionHandle
instruction handle to reference
ih
,
int src_line)

Create a line number.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public boolean

Returns:

true, if ih is target of this line number
containsTarget
(InstructionHandle ih)

Implements org.aspectj.apache.bcel.generic.InstructionTargeter.containsTarget.

public InstructionHandle
public LineNumber
getLineNumber()

Get LineNumber attribute .

public int
public void
public void
setSourceLine(int src_line)

public void
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ihback to summary
private InstructionHandle ih
src_lineback to summary
private int src_line

Constructor Detail

LineNumberGenback to summary
public LineNumberGen(InstructionHandle ih, int src_line)

Create a line number.

Parameters
ih:InstructionHandle

instruction handle to reference

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

containsTargetback to summary
public boolean containsTarget(InstructionHandle ih)

Implements org.aspectj.apache.bcel.generic.InstructionTargeter.containsTarget.

Returns:boolean

true, if ih is target of this line number

getInstructionback to summary
public InstructionHandle getInstruction()
getLineNumberback to summary
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.

getSourceLineback to summary
public int getSourceLine()
setInstructionback to summary
public void setInstruction(InstructionHandle ih)
setSourceLineback to summary
public void setSourceLine(int src_line)
updateTargetback to summary
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)

Implements org.aspectj.apache.bcel.generic.InstructionTargeter.updateTarget.

Parameters
old_ih:InstructionHandle

old target

new_ih:InstructionHandle

new target