当前位置: 首页>>代码示例>>Java>>正文


Java ConstantPool类代码示例

本文整理汇总了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);
    }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:28,代码来源:InstructionTracer.java

示例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);
}
 
开发者ID:sics-sse,项目名称:moped,代码行数:28,代码来源:InstructionTracer.java

示例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;
            }
        }
    }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:31,代码来源:InstructionEmitter.java

示例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;
        }
    }
}
 
开发者ID:sics-sse,项目名称:moped,代码行数:31,代码来源:InstructionEmitter.java

示例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);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:11,代码来源:ConstantObject.java

示例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);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:10,代码来源:ConstantFloat.java

示例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);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:10,代码来源:ConstantLong.java

示例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);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:10,代码来源:ConstantInt.java

示例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);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:10,代码来源:ConstantDouble.java


注:本文中的com.sun.squawk.translator.ci.ConstantPool类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。