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


Java NumericType类代码示例

本文整理汇总了Java中jdk.nashorn.internal.codegen.types.NumericType的典型用法代码示例。如果您正苦于以下问题:Java NumericType类的具体用法?Java NumericType怎么用?Java NumericType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NumericType类属于jdk.nashorn.internal.codegen.types包,在下文中一共展示了NumericType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: popNumeric

import jdk.nashorn.internal.codegen.types.NumericType; //导入依赖的package包/类
/**
 * Pop a type from the existing stack, ensuring that it is numeric. Boolean type is popped as int type.
 *
 * @return the type
 */
private NumericType popNumeric() {
    final Type type = popType();
    if(type.isBoolean()) {
        // Booleans are treated as int for purposes of arithmetic operations
        return Type.INT;
    }
    assert type.isNumeric();
    return (NumericType)type;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:MethodEmitter.java

示例2: get2n

import jdk.nashorn.internal.codegen.types.NumericType; //导入依赖的package包/类
/**
 * Helper function - expect two types that are numbers and equivalent
 *
 * @return common type
 */
private NumericType get2n() {
    final NumericType p0 = popNumeric();
    final NumericType p1 = popNumeric();
    assert p0.isEquivalentTo(p1) : "expecting equivalent types on stack but got " + p0 + " and " + p1;
    return p0;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:MethodEmitter.java

示例3: popNumeric

import jdk.nashorn.internal.codegen.types.NumericType; //导入依赖的package包/类
/**
 * Pop a type from the existing stack, ensuring that it is numeric,
 * assert if not
 *
 * @return the type
 */
private NumericType popNumeric() {
    final Type type = stack.pop();
    assert type.isNumeric() : type + " is not numeric";
    return (NumericType)type;
}
 
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:12,代码来源:MethodEmitter.java


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