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


Java Type.toHuman方法代码示例

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


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

示例1: checkReturnType

import com.android.dx.rop.type.Type; //导入方法依赖的package包/类
/**
 * Checks whether the prototype is compatible with returning the
 * given type, and throws if not.
 *
 * @param encountered {@code non-null;} the encountered return type
 */
private void checkReturnType(Type encountered) {
    Type returnType = machine.getPrototype().getReturnType();

    /*
     * Check to see if the prototype's return type is
     * possibly assignable from the type we encountered. This
     * takes care of all the salient cases (types are the same,
     * they're compatible primitive types, etc.).
     */
    if (!Merger.isPossiblyAssignableFrom(returnType, encountered)) {
        throw new SimException("return type mismatch: prototype " +
                "indicates " + returnType.toHuman() +
                ", but encountered type " + encountered.toHuman());
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:22,代码来源:Simulator.java

示例2: popArgs

import com.android.dx.rop.type.Type; //导入方法依赖的package包/类
/** {@inheritDoc} */
public final void popArgs(Frame frame, Type type1, Type type2) {
    // Use the above method to do the actual popping...
    popArgs(frame, 2);

    // ...and then verify the popped types.

    if (! Merger.isPossiblyAssignableFrom(type1, args[0])) {
        throw new SimException("expected type " + type1.toHuman() +
                " but found " + args[0].getType().toHuman());
    }

    if (! Merger.isPossiblyAssignableFrom(type2, args[1])) {
        throw new SimException("expected type " + type2.toHuman() +
                " but found " + args[1].getType().toHuman());
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:18,代码来源:BaseMachine.java

示例3: zeroFor

import com.android.dx.rop.type.Type; //导入方法依赖的package包/类
/**
 * Gets the "zero" (or {@code null}) value for the given type.
 *
 * @param type {@code non-null;} the type in question
 * @return {@code non-null;} its "zero" value
 */
public static Constant zeroFor(Type type) {
    switch (type.getBasicType()) {
        case Type.BT_BOOLEAN: return CstBoolean.VALUE_FALSE;
        case Type.BT_BYTE:    return CstByte.VALUE_0;
        case Type.BT_CHAR:    return CstChar.VALUE_0;
        case Type.BT_DOUBLE:  return CstDouble.VALUE_0;
        case Type.BT_FLOAT:   return CstFloat.VALUE_0;
        case Type.BT_INT:     return CstInteger.VALUE_0;
        case Type.BT_LONG:    return CstLong.VALUE_0;
        case Type.BT_SHORT:   return CstShort.VALUE_0;
        case Type.BT_OBJECT:  return CstKnownNull.THE_ONE;
        default: {
            throw new UnsupportedOperationException("no zero for type: " +
                    type.toHuman());
        }
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:24,代码来源:Zeroes.java


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