org.apache.bcel.generic
Class CPInstruction
- java.lang.Object
-
- org.apache.bcel.generic.Instruction
-
- org.apache.bcel.generic.CPInstruction
-
- All Implemented Interfaces:
- java.lang.Cloneable, IndexedInstruction, TypedInstruction
- Direct Known Subclasses:
- ANEWARRAY, CHECKCAST, FieldOrMethod, INSTANCEOF, LDC, LDC2_W, MULTIANEWARRAY, NameSignatureInstruction, NEW
public abstract class CPInstruction extends Instruction implements TypedInstruction, IndexedInstruction
Abstract super class for instructions that use an index into the constant pool such as LDC, INVOKEVIRTUAL, etc.- See Also:
ConstantPoolGen,LDC,INVOKEVIRTUAL
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddump(java.io.DataOutputStream out)Dump instruction as byte code to stream out.intgetIndex()TypegetType(ConstantPoolGen cpg)voidsetIndex(int index)Set the index to constant pool.java.lang.StringtoString(boolean verbose)Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool index>">"java.lang.StringtoString(ConstantPool cp)-
Methods inherited from class org.apache.bcel.generic.Instruction
accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, toString
-
-
-
-
Method Detail
-
dump
public void dump(java.io.DataOutputStream out) throws java.io.IOExceptionDump instruction as byte code to stream out.- Overrides:
dumpin classInstruction- Parameters:
out- Output stream- Throws:
java.io.IOException
-
toString
public java.lang.String toString(boolean verbose)
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool index>">"- Overrides:
toStringin classInstruction- Parameters:
verbose- long/short format switch- Returns:
- mnemonic for instruction
-
toString
public java.lang.String toString(ConstantPool cp)
- Overrides:
toStringin classInstruction- Returns:
- mnemonic for instruction with symbolic references resolved
-
getIndex
public final int getIndex()
- Specified by:
getIndexin interfaceIndexedInstruction- Returns:
- index in constant pool referred by this instruction.
-
setIndex
public void setIndex(int index)
Set the index to constant pool.- Specified by:
setIndexin interfaceIndexedInstruction- Parameters:
index- in constant pool.
-
getType
public Type getType(ConstantPoolGen cpg)
- Specified by:
getTypein interfaceTypedInstruction- Returns:
- type related with this instruction.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG