|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.bcel.generic.Instruction
public abstract class Instruction
Abstract super class for all Java byte codes.
Field Summary | |
---|---|
protected short |
length
|
protected short |
opcode
|
Constructor Summary | |
---|---|
Instruction(short opcode,
short length)
|
Method Summary | |
---|---|
abstract void |
accept(Visitor v)
Call corresponding visitor method(s). |
int |
consumeStack(ConstantPoolGen cpg)
This method also gives right results for instructions whose effect on the stack depends on the constant pool entry they reference. |
Instruction |
copy()
Use with caution, since `BranchInstruction's have a `target' reference which is not copied correctly (only basic types are). |
void |
dump(DataOutputStream out)
Dump instruction as byte code to stream out. |
boolean |
equals(Object that)
Check for equality, delegated to comparator |
static InstructionComparator |
getComparator()
Get Comparator object used in the equals() method to determine equality of instructions. |
int |
getLength()
|
String |
getName()
|
short |
getOpcode()
|
protected void |
initFromFile(ByteSequence bytes,
boolean wide)
Read needed data (e.g. |
int |
produceStack(ConstantPoolGen cpg)
This method also gives right results for instructions whose effect on the stack depends on the constant pool entry they reference. |
static Instruction |
readInstruction(ByteSequence bytes)
Read an instruction from (byte code) input stream and return the appropiate object. |
static void |
setComparator(InstructionComparator c)
Set comparator to be used for equals(). |
String |
toString()
|
String |
toString(boolean verbose)
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" |
String |
toString(ConstantPool cp)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected short length
protected short opcode
Constructor Detail |
---|
public Instruction(short opcode, short length)
Method Detail |
---|
public void dump(DataOutputStream out) throws IOException
out
- Output stream
IOException
public String getName()
public String toString(boolean verbose)
verbose
- long/short format switch
public String toString()
toString
in class Object
public String toString(ConstantPool cp)
public Instruction copy()
BranchInstruction
protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
bytes
- byte sequence to read fromwide
- "wide" instruction flag
IOException
public static final Instruction readInstruction(ByteSequence bytes) throws IOException
bytes
- input stream bytes
IOException
public int consumeStack(ConstantPoolGen cpg)
public int produceStack(ConstantPoolGen cpg)
public short getOpcode()
public int getLength()
public abstract void accept(Visitor v)
v
- Visitor objectpublic static InstructionComparator getComparator()
public static void setComparator(InstructionComparator c)
public boolean equals(Object that)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |