org.apache.bcel.generic

Class LDC

Implemented Interfaces:
Cloneable, ExceptionThrower, IndexedInstruction, PushInstruction, Serializable, StackProducer, TypedInstruction
Known Direct Subclasses:
LDC_W

public class LDC
extends CPInstruction
implements PushInstruction, ExceptionThrower, TypedInstruction

LDC - Push item from constant pool.
Stack: ... -> ..., item
Version:
$Id: LDC.java,v 1.1.1.1 2001/10/29 20:00:21 jvanzyl Exp $
Author:
M. Dahm

Field Summary

Fields inherited from class org.apache.bcel.generic.CPInstruction

index

Fields inherited from class org.apache.bcel.generic.Instruction

length, opcode

Constructor Summary

LDC(int index)

Method Summary

void
accept(Visitor v)
Call corresponding visitor method(s).
void
dump(DataOutputStream out)
Dump instruction as byte code to stream out.
Class[]
getExceptions()
Type
getType(ConstantPoolGen cpg)
Object
getValue(ConstantPoolGen cpg)
protected void
initFromFile(ByteSequence bytes, boolean wide)
Read needed data (e.g.
void
setIndex(int index)
Set the index to constant pool and adjust size.
protected void
setSize()

Methods inherited from class org.apache.bcel.generic.CPInstruction

dump, getIndex, getType, initFromFile, setIndex, toString, toString

Methods inherited from class org.apache.bcel.generic.Instruction

accept, consumeStack, copy, dump, equals, getComparator, getLength, getName, getOpcode, initFromFile, produceStack, readInstruction, setComparator, toString, toString, toString

Constructor Details

LDC

public LDC(int index)

Method Details

accept

public void accept(Visitor v)
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.
Overrides:
accept in interface Instruction
Parameters:
v - Visitor object

dump

public void dump(DataOutputStream out)
            throws IOException
Dump instruction as byte code to stream out.
Overrides:
dump in interface CPInstruction
Parameters:
out - Output stream

getExceptions

public Class[] getExceptions()
Specified by:
getExceptions in interface ExceptionThrower

getType

public Type getType(ConstantPoolGen cpg)
Specified by:
getType in interface TypedInstruction
Overrides:
getType in interface CPInstruction

getValue

public Object getValue(ConstantPoolGen cpg)

initFromFile

protected void initFromFile(ByteSequence bytes,
                            boolean wide)
            throws IOException
Read needed data (e.g. index) from file.
Overrides:
initFromFile in interface CPInstruction

setIndex

public final void setIndex(int index)
Set the index to constant pool and adjust size.
Specified by:
setIndex in interface IndexedInstruction
Overrides:
setIndex in interface CPInstruction

setSize

protected final void setSize()