public abstract class CPInstruction extends Instruction implements TypedInstruction, IndexedInstruction
ConstantPoolGen
,
LDC
,
INVOKEVIRTUAL
Modifier and Type | Field and Description |
---|---|
protected int |
index
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
length, opcode
Modifier | Constructor and Description |
---|---|
protected |
CPInstruction(short opcode,
int index) |
Modifier and Type | Method and Description |
---|---|
void |
dump(DataOutputStream out)
Dump instruction as byte code to stream out.
|
int |
getIndex() |
Type |
getType(ConstantPoolGen cpg) |
protected void |
initFromFile(ByteSequence bytes,
boolean wide)
Read needed data (i.e., index) from file.
|
void |
setIndex(int index)
Set the index to constant pool.
|
String |
toString(boolean verbose)
Long output format:
<name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< constant pool
index>">"
|
String |
toString(ConstantPool cp) |
accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, toString
@Deprecated protected int index
protected CPInstruction(short opcode, int index)
index
- to constant poolpublic void dump(DataOutputStream out) throws IOException
dump
in class Instruction
out
- Output streamIOException
- Thrown when an I/O exception of some sort has occurred.public final int getIndex()
getIndex
in interface IndexedInstruction
public Type getType(ConstantPoolGen cpg)
getType
in interface TypedInstruction
protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
initFromFile
in class Instruction
bytes
- input streamwide
- wide prefix?IOException
- may be thrown if the implementation needs to read data from the filepublic void setIndex(int index)
setIndex
in interface IndexedInstruction
index
- in constant pool.public String toString(boolean verbose)
toString
in class Instruction
verbose
- long/short format switchpublic String toString(ConstantPool cp)
toString
in class Instruction
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.