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


Java Wrapper.ordinal方法代码示例

本文整理汇总了Java中sun.invoke.util.Wrapper.ordinal方法的典型用法代码示例。如果您正苦于以下问题:Java Wrapper.ordinal方法的具体用法?Java Wrapper.ordinal怎么用?Java Wrapper.ordinal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.invoke.util.Wrapper的用法示例。


在下文中一共展示了Wrapper.ordinal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: widen

import sun.invoke.util.Wrapper; //导入方法依赖的package包/类
void widen(Wrapper ws, Wrapper wt) {
    if (ws != wt) {
        int opcode = wideningOpcodes[ws.ordinal()][wt.ordinal()];
        if (opcode != Opcodes.NOP) {
            visitInsn(opcode);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:TypeConvertingMethodAdapter.java

示例2: identity

import sun.invoke.util.Wrapper; //导入方法依赖的package包/类
/**
 * Produces a method handle which returns its sole argument when invoked.
 * @param type the type of the sole parameter and return value of the desired method handle
 * @return a unary method handle which accepts and returns the given type
 * @throws NullPointerException if the argument is null
 * @throws IllegalArgumentException if the given type is {@code void.class}
 */
public static
MethodHandle identity(Class<?> type) {
    Wrapper btw = (type.isPrimitive() ? Wrapper.forPrimitiveType(type) : Wrapper.OBJECT);
    int pos = btw.ordinal();
    MethodHandle ident = IDENTITY_MHS[pos];
    if (ident == null) {
        ident = setCachedMethodHandle(IDENTITY_MHS, pos, makeIdentity(btw.primitiveType()));
    }
    if (ident.type().returnType() == type)
        return ident;
    // something like identity(Foo.class); do not bother to intern these
    assert(btw == Wrapper.OBJECT);
    return makeIdentity(type);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:MethodHandles.java

示例3: identity

import sun.invoke.util.Wrapper; //导入方法依赖的package包/类
/**
 * Produces a method handle which returns its sole argument when invoked.
 * @param type the type of the sole parameter and return value of the desired method handle
 * @return a unary method handle which accepts and returns the given type
 * @throws NullPointerException if the argument is null
 * @throws IllegalArgumentException if the given type is {@code void.class}
 */
public static
MethodHandle identity(Class<?> type) {
    Wrapper btw = (type.isPrimitive() ? Wrapper.forPrimitiveType(type) : Wrapper.OBJECT);
    int pos = btw.ordinal();
    MethodHandle ident = IDENTITY_MHS[pos];
    if (ident == null) {
        ident = setCachedMethodHandle(IDENTITY_MHS, pos, makeIdentity(btw.primitiveType()));
    }
    if (ident.type().returnType() == type)
        return ident;
    // something like identity(Foo.class); do not bother to intern these
    assert (btw == Wrapper.OBJECT);
    return makeIdentity(type);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:MethodHandles.java

示例4: initWidening

import sun.invoke.util.Wrapper; //导入方法依赖的package包/类
private static void initWidening(Wrapper to, int opcode, Wrapper... from) {
    for (Wrapper f : from) {
        wideningOpcodes[f.ordinal()][to.ordinal()] = opcode;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:TypeConvertingMethodAdapter.java


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