本文整理汇总了Java中com.sun.squawk.translator.ci.ConstantPool类的典型用法代码示例。如果您正苦于以下问题:Java ConstantPool类的具体用法?Java ConstantPool怎么用?Java ConstantPool使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConstantPool类属于com.sun.squawk.translator.ci包,在下文中一共展示了ConstantPool类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doConstant
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void doConstant(Constant instruction) {
int tag = instruction.getTag();
int opcode;
Object value = instruction.getValue();
switch (tag) {
/*if[FLOATS]*/
case ConstantPool.CONSTANT_Double: opcode = OPC.CONST_DOUBLE; break;
case ConstantPool.CONSTANT_Float: opcode = OPC.CONST_FLOAT; break;
/*end[FLOATS]*/
case ConstantPool.CONSTANT_Long: opcode = OPC.CONST_LONG; break;
case ConstantPool.CONSTANT_Integer: opcode = OPC.CONST_INT; break;
default: {
if (value == null) {
opcode = OPC.CONST_NULL;
value = "";
} else {
opcode = OPC.OBJECT;
value = "\"" + value + "\"";
}
break;
}
}
out.append(Mnemonics.getMnemonic(opcode) + " " + value);
}
示例2: doConstant
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void doConstant(Constant instruction) {
int tag = instruction.getTag();
int opcode;
Object value = instruction.getValue();
switch (tag) {
case ConstantPool.CONSTANT_Double: opcode = OPC.CONST_DOUBLE; break;
case ConstantPool.CONSTANT_Float: opcode = OPC.CONST_FLOAT; break;
case ConstantPool.CONSTANT_Long: opcode = OPC.CONST_LONG; break;
case ConstantPool.CONSTANT_Integer: opcode = OPC.CONST_INT; break;
default: {
if (value == null) {
opcode = OPC.CONST_NULL;
value = "";
} else {
opcode = OPC.OBJECT;
value = "\"" + value + "\"";
}
break;
}
}
out.append(Mnemonics.getMnemonic(opcode) + " " + value);
}
示例3: doConstant
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void doConstant(Constant instruction) {
Object value = instruction.getValue();
switch (instruction.getTag()) {
/*if[FLOATS]*/
case ConstantPool.CONSTANT_Double: {
emitConstantDouble(((Double)value).doubleValue());
break;
}
case ConstantPool.CONSTANT_Float: {
emitConstantFloat(((Float)value).floatValue());
break;
}
/*end[FLOATS]*/
case ConstantPool.CONSTANT_Long: {
emitConstantLong(((Long)value).longValue());
break;
}
case ConstantPool.CONSTANT_Integer: {
emitConstantInt(((Integer)value).intValue());
break;
}
default: {
emitConstantObject(value);
break;
}
}
}
示例4: doConstant
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void doConstant(Constant instruction) {
Object value = instruction.getValue();
switch (instruction.getTag()) {
case ConstantPool.CONSTANT_Double: {
emitConstantDouble(((Double)value).doubleValue());
break;
}
case ConstantPool.CONSTANT_Float: {
emitConstantFloat(((Float)value).floatValue());
break;
}
case ConstantPool.CONSTANT_Long: {
emitConstantLong(((Long)value).longValue());
break;
}
case ConstantPool.CONSTANT_Integer: {
emitConstantInt(((Integer)value).intValue());
break;
}
default: {
emitConstantObject(value);
break;
}
}
}
示例5: ConstantObject
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* Creates a <code>ConstantObject</code> instance representing the
* loading of a constant object value to the operand stack.
*
* @param type the type of the value
* @param value the object value
*/
public ConstantObject(Klass type, Object value) {
super(type, ConstantPool.CONSTANT_Object, value);
}
示例6: ConstantFloat
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* Creates a <code>ConstantFloat</code> instance representing the
* loading of a constant float value to the operand stack.
*
* @param value the float value (wrapped in a {@link Float} object)
*/
public ConstantFloat(Float value) {
super(Klass.FLOAT, ConstantPool.CONSTANT_Float, value);
}
示例7: ConstantLong
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* Creates a <code>ConstantLong</code> instance representing the
* loading of a constant long value to the operand stack.
*
* @param value the long value (wrapped in a {@link Long} object)
*/
public ConstantLong(Long value) {
super(Klass.LONG, ConstantPool.CONSTANT_Long, value);
}
示例8: ConstantInt
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* Creates a <code>ConstantInt</code> instance representing the
* loading of a constant integer value to the operand stack.
*
* @param value the integer value (wrapped in a {@link Integer} object)
*/
public ConstantInt(Integer value) {
super(Klass.INT, ConstantPool.CONSTANT_Integer, value);
}
示例9: ConstantDouble
import com.sun.squawk.translator.ci.ConstantPool; //导入依赖的package包/类
/**
* Creates a <code>ConstantDouble</code> instance representing the
* loading of a constant double value to the operand stack.
*
* @param value the double value (wrapped in a {@link Double} object)
*/
public ConstantDouble(Double value) {
super(Klass.DOUBLE, ConstantPool.CONSTANT_Double, value);
}