|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.classfile.AbstractInstructionAccessor
org.multijava.util.classfile.Instruction
org.multijava.util.classfile.PushLiteralInstruction
This class encapsulates the instructions pushing a literal on the stack: bipush, sipush, ldc, ldc_w, ldc2_w, dconst_<d>, fconst_<f>, iconst_<i>, lconst_<l>
| Nested Class Summary | |
(package private) class |
PushLiteralInstruction.ByteOperand
|
(package private) class |
PushLiteralInstruction.ConstantOperand
|
(package private) static interface |
PushLiteralInstruction.Operand
|
(package private) class |
PushLiteralInstruction.ShortOperand
|
| Field Summary | |
private PushLiteralInstruction.Operand |
operand
|
private Object |
value
|
| Fields inherited from class org.multijava.util.classfile.Instruction |
|
| Constructor Summary | |
PushLiteralInstruction(double value)
Constructs an instruction that pushes a double literal on the stack. |
|
PushLiteralInstruction(float value)
Constructs an instruction that pushes a float literal on the stack. |
|
PushLiteralInstruction(int value)
Constructs an instruction that pushes a int literal on the stack. |
|
PushLiteralInstruction(String value)
Constructs an instruction that pushes a string literal on the stack. |
|
PushLiteralInstruction(long value)
Constructs an instruction that pushes a long literal on the stack. |
|
PushLiteralInstruction(PooledConstant cst,
boolean wide)
Constructs an instruction that pushes a string literal on the stack from a class file stream. |
|
| Method Summary | |
boolean |
canComplete()
Returns true iff control flow can reach the next instruction in textual order. |
Object |
getLiteral()
Returns the value of this literal |
int |
getPushedOnStack()
Returns the size of data pushed on the stack by this instruction |
byte |
getReturnType()
Returns the type pushed on the stack |
(package private) int |
getSize()
Returns the number of bytes used by the the instruction in the code array. |
int |
getStack()
Return the amount of stack (positive or negative) used by this instruction |
boolean |
isLiteral()
Return true if this instruction is a literal |
(package private) void |
resolveConstants(ConstantPool cp)
Insert or check location of constant value on constant pool |
(package private) void |
write(ConstantPool cp,
DataOutput out)
Write this instruction into a file |
| Methods inherited from class org.multijava.util.classfile.Instruction |
check, computeEndAddress, dump, getAddress, getLocalVar, getOpcode, getPoppedFromStack, setAddress, setOpcode |
| Methods inherited from class org.multijava.util.classfile.AbstractInstructionAccessor |
transform |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private PushLiteralInstruction.Operand operand
private Object value
| Constructor Detail |
public PushLiteralInstruction(double value)
value - a double literalpublic PushLiteralInstruction(float value)
value - a float literalpublic PushLiteralInstruction(int value)
value - a int literalpublic PushLiteralInstruction(long value)
value - a long literalpublic PushLiteralInstruction(String value)
value - a string literal
public PushLiteralInstruction(PooledConstant cst,
boolean wide)
cst - a pooled constantwide - does this constant use 2 slots in the pool ?| Method Detail |
public boolean canComplete()
public boolean isLiteral()
isLiteral in class Instructionint getSize()
public Object getLiteral()
public int getPushedOnStack()
public byte getReturnType()
public int getStack()
void resolveConstants(ConstantPool cp)
cp - the constant pool for this class
void write(ConstantPool cp,
DataOutput out)
throws IOException
cp - the constant pool that contain all dataout - the file where to write this object info
IOException - an io problem has occured
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||