|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wisc.cs.java.Bytecode
This class is used to represent all bytecodes which constant lengths and is the superclass of all other classes which represent Java bytecodes.
Field Summary | |
protected int |
opcode
The opcode of this instruction. |
protected byte[] |
params
An array containing bytes which are parameters for this instruction. |
protected boolean |
wide
True if this instruction has the wide modifier, false otherwise. |
Constructor Summary | |
protected |
Bytecode()
Constructs a genaric bytecode for sub-classes. |
|
Bytecode(boolean w,
int op,
byte[] p)
Constructs a new bytecode with the given opcode and parameters. |
Method Summary | |
int |
getConstantIndex()
If this bytecode references the constant pool, it returns the index. |
int |
getNBytes()
Returns the number of bytes needed to represent this instruction. |
int |
getOpcode()
Return the opcode for this instruction.s |
int |
getParamBytes()
Returns the number of parameter bytes for this instruction. |
boolean |
isWide()
Returns true if the instruction has the wide modifier, false otherwise. |
java.lang.String |
toString()
Returns a string representation of this bytecode. |
void |
writeTo(java.io.DataOutputStream out)
Writes a bytecode to the specified stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected boolean wide
protected int opcode
protected byte[] params
Constructor Detail |
protected Bytecode()
public Bytecode(boolean w, int op, byte[] p)
w
- true if this is to be a wide instruction, false otherwise.op
- the opcode for the new instruction.p
- an array of parameter bytes.Method Detail |
public void writeTo(java.io.DataOutputStream out) throws java.io.IOException
out
- a stream to write the bytecode data to.public int getConstantIndex()
public int getParamBytes()
public boolean isWide()
public int getOpcode()
public int getNBytes()
public java.lang.String toString()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |