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

public Class LDC

extends CPInstruction
implements PushInstruction, ExceptionThrower
Class Inheritance
All Implemented Interfaces
org.apache.bcel.generic.ExceptionThrower, org.apache.bcel.generic.PushInstruction, org.apache.bcel.generic.StackProducer
Known Direct Subclasses
org.apache.bcel.generic.LDC_W
Imports
java.io.DataOutputStream, .IOException, org.apache.bcel.ExceptionConst, org.apache.bcel.util.ByteSequence

LDC - Push item from constant pool.
Stack: ... -> ..., item

Field Summary

Inherited from org.apache.bcel.generic.CPInstruction:
index

Constructor Summary

AccessConstructor and Description
pack-priv
LDC()

Empty constructor needed for Instruction.readInstruction.

public
LDC(final int index)

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements abstract org.apache.bcel.generic.Instruction.accept.

Call corresponding visitor method(s).
public void
dump(final DataOutputStream
Output stream
out
)

Overrides org.apache.bcel.generic.CPInstruction.dump.

Dump instruction as byte code to stream out.
public Class<?>[]
public Type
public Object
protected void
initFromFile(final ByteSequence
input stream
bytes
,
final boolean
wide prefix?
wide
)

Overrides org.apache.bcel.generic.CPInstruction.initFromFile.

Read needed data (e.g. index) from file.
public final void
setIndex(final int
in constant pool.
index
)

Overrides org.apache.bcel.generic.CPInstruction.setIndex.

Implements org.apache.bcel.generic.IndexedInstruction.setIndex.

Sets the index to constant pool and adjust size.
protected final void
Inherited from org.apache.bcel.generic.CPInstruction:
getIndextoStringtoString

Constructor Detail

LDCback to summary
pack-priv LDC()

Empty constructor needed for Instruction.readInstruction. Not to be used otherwise.

LDCback to summary
public LDC(final int index)

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract org.apache.bcel.generic.Instruction.accept.

Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last.

Parameters
v:Visitor

Visitor object

Annotations
@Override
dumpback to summary
public void dump(final DataOutputStream out) throws IOException

Overrides org.apache.bcel.generic.CPInstruction.dump.

Dump instruction as byte code to stream out.

Parameters
out:DataOutputStream

Output stream

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.bcel.generic.Instruction.dump.

Thrown when an I/O exception of some sort has occurred.

getExceptionsback to summary
public Class<?>[] getExceptions()

Implements org.apache.bcel.generic.ExceptionThrower.getExceptions.

Annotations
@Override
getTypeback to summary
public Type getType(final ConstantPoolGen cpg)

Overrides org.apache.bcel.generic.CPInstruction.getType.

Implements org.apache.bcel.generic.TypedInstruction.getType.

Returns:Type

Doc from org.apache.bcel.generic.CPInstruction.getType.

type related with this instruction.

Annotations
@Override
getValueback to summary
public Object getValue(final ConstantPoolGen cpg)
initFromFileback to summary
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException

Overrides org.apache.bcel.generic.CPInstruction.initFromFile.

Read needed data (e.g. index) from file.

Parameters
bytes:ByteSequence

Doc from org.apache.bcel.generic.CPInstruction.initFromFile.

input stream

wide:boolean

Doc from org.apache.bcel.generic.CPInstruction.initFromFile.

wide prefix?

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.bcel.generic.Instruction.initFromFile.

may be thrown if the implementation needs to read data from the file

setIndexback to summary
public final void setIndex(final int index)

Overrides org.apache.bcel.generic.CPInstruction.setIndex.

Implements org.apache.bcel.generic.IndexedInstruction.setIndex.

Sets the index to constant pool and adjust size.

Parameters
index:int

Doc from org.apache.bcel.generic.CPInstruction.setIndex.

in constant pool.

Annotations
@Override
setSizeback to summary
protected final void setSize()