本文整理汇总了Java中com.sun.squawk.translator.ci.ConstantPool.CONSTANT_Float方法的典型用法代码示例。如果您正苦于以下问题:Java ConstantPool.CONSTANT_Float方法的具体用法?Java ConstantPool.CONSTANT_Float怎么用?Java ConstantPool.CONSTANT_Float使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.squawk.translator.ci.ConstantPool
的用法示例。
在下文中一共展示了ConstantPool.CONSTANT_Float方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}