APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.generic

public Class LineNumberGen

extends Object
implements InstructionTargeter, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, com.sun.org.apache.bcel.internal.generic.InstructionTargeter
Imports
java.util.Objects, com.sun.org.apache.bcel.internal.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.
See Also
LineNumber, MethodGen

Field Summary

Modifier and TypeField and Description
pack-priv static final LineNumberGen[]
private InstructionHandle
private int

Constructor Summary

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

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
(final InstructionHandle ih)

Implements com.sun.org.apache.bcel.internal.generic.InstructionTargeter.containsTarget.

Tests whether this targeter targets the specified instruction handle.

public InstructionHandle
public LineNumber
getLineNumber()

Gets LineNumber attribute.

public int
public void
setInstruction(final InstructionHandle instructionHandle)

public void
setSourceLine(final int srcLine)

public void
updateTarget(final InstructionHandle
old target
oldIh
,
final InstructionHandle
new target
newIh
)

Implements com.sun.org.apache.bcel.internal.generic.InstructionTargeter.updateTarget.

Replaces the target of this targeter from this old handle to the new handle.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_ARRAYback to summary
pack-priv static final LineNumberGen[] EMPTY_ARRAY
ihback to summary
private InstructionHandle ih
srcLineback to summary
private int srcLine

Constructor Detail

LineNumberGenback to summary
public LineNumberGen(final InstructionHandle ih, final int srcLine)

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.

Annotations
@Override
containsTargetback to summary
public boolean containsTarget(final InstructionHandle ih)

Implements com.sun.org.apache.bcel.internal.generic.InstructionTargeter.containsTarget.

Doc from com.sun.org.apache.bcel.internal.generic.InstructionTargeter.containsTarget.

Tests whether this targeter targets the specified instruction handle.

Returns:boolean

true, if ih is target of this line number

Annotations
@Override
getInstructionback to summary
public InstructionHandle getInstruction()
getLineNumberback to summary
public LineNumber getLineNumber()

Gets LineNumber attribute. This relies on that the instruction list has already been dumped to byte code or that the 'setPositions' methods has been called for the instruction list.

getSourceLineback to summary
public int getSourceLine()
setInstructionback to summary
public void setInstruction(final InstructionHandle instructionHandle)
setSourceLineback to summary
public void setSourceLine(final int srcLine)
updateTargetback to summary
public void updateTarget(final InstructionHandle oldIh, final InstructionHandle newIh)

Implements com.sun.org.apache.bcel.internal.generic.InstructionTargeter.updateTarget.

Doc from com.sun.org.apache.bcel.internal.generic.InstructionTargeter.updateTarget.

Replaces the target of this targeter from this old handle to the new handle.

Parameters
oldIh:InstructionHandle

old target

newIh:InstructionHandle

new target

Annotations
@Override