LDC2_Wpublic class LDC2_W extends CPInstruction implements TypedInstruction, PushInstructionLDC2_W - Push long or double from constant pool
Stack: ... -> ..., item.word1, item.word2 |
Constructors Summary |
---|
LDC2_W()Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction(). Not to be used otherwise.
| public LDC2_W(int index)
super(com.sun.org.apache.bcel.internal.Constants.LDC2_W, index);
|
Methods Summary |
---|
public void | accept(com.sun.org.apache.bcel.internal.generic.Visitor v)Call corresponding visitor method(s). The order is:
Call visitor methods of implemented interfaces first, then
call methods according to the class hierarchy in descending order,
i.e., the most specific visitXXX() call comes last.
v.visitStackProducer(this);
v.visitPushInstruction(this);
v.visitTypedInstruction(this);
v.visitCPInstruction(this);
v.visitLDC2_W(this);
| public com.sun.org.apache.bcel.internal.generic.Type | getType(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cpg)
switch(cpg.getConstantPool().getConstant(index).getTag()) {
case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Long: return Type.LONG;
case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Double: return Type.DOUBLE;
default: // Never reached
throw new RuntimeException("Unknown constant type " + opcode);
}
| public java.lang.Number | getValue(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cpg)
com.sun.org.apache.bcel.internal.classfile.Constant c = cpg.getConstantPool().getConstant(index);
switch(c.getTag()) {
case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Long:
return new Long(((com.sun.org.apache.bcel.internal.classfile.ConstantLong)c).getBytes());
case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Double:
return new Double(((com.sun.org.apache.bcel.internal.classfile.ConstantDouble)c).getBytes());
default: // Never reached
throw new RuntimeException("Unknown or invalid constant type at " + index);
}
|
|