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


Java Type.BT_SHORT属性代码示例

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


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

示例1: opAget

/**
 * Returns the appropriate {@code aget} rop for the given type. The
 * result is a shared instance.
 *
 * @param type {@code non-null;} element type of array being accessed
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opAget(TypeBearer type) {
    switch (type.getBasicType()) {
        case Type.BT_INT:     return AGET_INT;
        case Type.BT_LONG:    return AGET_LONG;
        case Type.BT_FLOAT:   return AGET_FLOAT;
        case Type.BT_DOUBLE:  return AGET_DOUBLE;
        case Type.BT_OBJECT:  return AGET_OBJECT;
        case Type.BT_BOOLEAN: return AGET_BOOLEAN;
        case Type.BT_BYTE:    return AGET_BYTE;
        case Type.BT_CHAR:    return AGET_CHAR;
        case Type.BT_SHORT:   return AGET_SHORT;
    }

    return throwBadType(type);
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:22,代码来源:Rops.java

示例2: opAput

/**
 * Returns the appropriate {@code aput} rop for the given type. The
 * result is a shared instance.
 *
 * @param type {@code non-null;} element type of array being accessed
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opAput(TypeBearer type) {
    switch (type.getBasicType()) {
        case Type.BT_INT:     return APUT_INT;
        case Type.BT_LONG:    return APUT_LONG;
        case Type.BT_FLOAT:   return APUT_FLOAT;
        case Type.BT_DOUBLE:  return APUT_DOUBLE;
        case Type.BT_OBJECT:  return APUT_OBJECT;
        case Type.BT_BOOLEAN: return APUT_BOOLEAN;
        case Type.BT_BYTE:    return APUT_BYTE;
        case Type.BT_CHAR:    return APUT_CHAR;
        case Type.BT_SHORT:   return APUT_SHORT;
    }

    return throwBadType(type);
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:22,代码来源:Rops.java

示例3: forBoxedPrimitiveType

/**
 * Returns an instance of this class that represents the wrapper
 * class corresponding to a given primitive type. For example, if
 * given {@link Type#INT}, this method returns the class reference
 * {@code java.lang.Integer}.
 *
 * @param primitiveType {@code non-null;} the primitive type
 * @return {@code non-null;} the corresponding wrapper class
 */
public static CstType forBoxedPrimitiveType(Type primitiveType) {
    switch (primitiveType.getBasicType()) {
        case Type.BT_BOOLEAN: return BOOLEAN;
        case Type.BT_BYTE:    return BYTE;
        case Type.BT_CHAR:    return CHARACTER;
        case Type.BT_DOUBLE:  return DOUBLE;
        case Type.BT_FLOAT:   return FLOAT;
        case Type.BT_INT:     return INTEGER;
        case Type.BT_LONG:    return LONG;
        case Type.BT_SHORT:   return SHORT;
        case Type.BT_VOID:    return VOID;
    }

    throw new IllegalArgumentException("not primitive: " + primitiveType);
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:24,代码来源:CstType.java

示例4: opPutField

/**
 * Returns the appropriate {@code put-field} rop for the given
 * type. The result is a shared instance.
 *
 * @param type {@code non-null;} type of the field in question
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opPutField(TypeBearer type) {
    switch (type.getBasicType()) {
        case Type.BT_INT:     return PUT_FIELD_INT;
        case Type.BT_LONG:    return PUT_FIELD_LONG;
        case Type.BT_FLOAT:   return PUT_FIELD_FLOAT;
        case Type.BT_DOUBLE:  return PUT_FIELD_DOUBLE;
        case Type.BT_OBJECT:  return PUT_FIELD_OBJECT;
        case Type.BT_BOOLEAN: return PUT_FIELD_BOOLEAN;
        case Type.BT_BYTE:    return PUT_FIELD_BYTE;
        case Type.BT_CHAR:    return PUT_FIELD_CHAR;
        case Type.BT_SHORT:   return PUT_FIELD_SHORT;
    }

    return throwBadType(type);
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:22,代码来源:Rops.java

示例5: opPutStatic

/**
 * Returns the appropriate {@code put-static} rop for the given
 * type. The result is a shared instance.
 *
 * @param type {@code non-null;} type of the field in question
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opPutStatic(TypeBearer type) {
    switch (type.getBasicType()) {
        case Type.BT_INT:     return PUT_STATIC_INT;
        case Type.BT_LONG:    return PUT_STATIC_LONG;
        case Type.BT_FLOAT:   return PUT_STATIC_FLOAT;
        case Type.BT_DOUBLE:  return PUT_STATIC_DOUBLE;
        case Type.BT_OBJECT:  return PUT_STATIC_OBJECT;
        case Type.BT_BOOLEAN: return PUT_STATIC_BOOLEAN;
        case Type.BT_BYTE:    return PUT_STATIC_BYTE;
        case Type.BT_CHAR:    return PUT_STATIC_CHAR;
        case Type.BT_SHORT:   return PUT_STATIC_SHORT;
    }

    return throwBadType(type);
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:22,代码来源:Rops.java

示例6: opGetField

/**
 * Returns the appropriate {@code get-field} rop for the given
 * type. The result is a shared instance.
 *
 * @param type {@code non-null;} type of the field in question
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opGetField(TypeBearer type) {
    switch (type.getBasicType()) {
        case Type.BT_INT:     return GET_FIELD_INT;
        case Type.BT_LONG:    return GET_FIELD_LONG;
        case Type.BT_FLOAT:   return GET_FIELD_FLOAT;
        case Type.BT_DOUBLE:  return GET_FIELD_DOUBLE;
        case Type.BT_OBJECT:  return GET_FIELD_OBJECT;
        case Type.BT_BOOLEAN: return GET_FIELD_BOOLEAN;
        case Type.BT_BYTE:    return GET_FIELD_BYTE;
        case Type.BT_CHAR:    return GET_FIELD_CHAR;
        case Type.BT_SHORT:   return GET_FIELD_SHORT;
    }

    return throwBadType(type);
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:22,代码来源:Rops.java

示例7: zeroFor

/**
 * 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,代码行数:23,代码来源:Zeroes.java

示例8: opNewArray

/**
 * Returns the appropriate {@code new-array} rop for the given
 * type. The result is a shared instance.
 *
 * @param arrayType {@code non-null;} array type of array being created
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opNewArray(TypeBearer arrayType) {
    Type type = arrayType.getType();
    Type elementType = type.getComponentType();

    switch (elementType.getBasicType()) {
        case Type.BT_INT:     return NEW_ARRAY_INT;
        case Type.BT_LONG:    return NEW_ARRAY_LONG;
        case Type.BT_FLOAT:   return NEW_ARRAY_FLOAT;
        case Type.BT_DOUBLE:  return NEW_ARRAY_DOUBLE;
        case Type.BT_BOOLEAN: return NEW_ARRAY_BOOLEAN;
        case Type.BT_BYTE:    return NEW_ARRAY_BYTE;
        case Type.BT_CHAR:    return NEW_ARRAY_CHAR;
        case Type.BT_SHORT:   return NEW_ARRAY_SHORT;
        case Type.BT_OBJECT: {
            return new Rop(RegOps.NEW_ARRAY, type, StdTypeList.INT,
                    Exceptions.LIST_Error_NegativeArraySizeException,
                    "new-array-object");
        }
    }

    return throwBadType(type);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:29,代码来源:Rops.java

示例9: opGetStatic

/**
 * Returns the appropriate {@code get-static} rop for the given
 * type. The result is a shared instance.
 *
 * @param type {@code non-null;} type of the field in question
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opGetStatic(TypeBearer type) {
    switch (type.getBasicType()) {
        case Type.BT_INT:     return GET_STATIC_INT;
        case Type.BT_LONG:    return GET_STATIC_LONG;
        case Type.BT_FLOAT:   return GET_STATIC_FLOAT;
        case Type.BT_DOUBLE:  return GET_STATIC_DOUBLE;
        case Type.BT_OBJECT:  return GET_STATIC_OBJECT;
        case Type.BT_BOOLEAN: return GET_STATIC_BOOLEAN;
        case Type.BT_BYTE:    return GET_STATIC_BYTE;
        case Type.BT_CHAR:    return GET_STATIC_CHAR;
        case Type.BT_SHORT:   return GET_STATIC_SHORT;
    }

    return throwBadType(type);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:22,代码来源:Rops.java

示例10: coerceConstant

/**
 * Helper for {@link #processFields}, which translates constants into
 * more specific types if necessary.
 *
 * @param constant {@code non-null;} the constant in question
 * @param type {@code non-null;} the desired type
 */
private static TypedConstant coerceConstant(TypedConstant constant,
        Type type) {
    Type constantType = constant.getType();

    if (constantType.equals(type)) {
        return constant;
    }

    switch (type.getBasicType()) {
        case Type.BT_BOOLEAN: {
            return CstBoolean.make(((CstInteger) constant).getValue());
        }
        case Type.BT_BYTE: {
            return CstByte.make(((CstInteger) constant).getValue());
        }
        case Type.BT_CHAR: {
            return CstChar.make(((CstInteger) constant).getValue());
        }
        case Type.BT_SHORT: {
            return CstShort.make(((CstInteger) constant).getValue());
        }
        default: {
            throw new UnsupportedOperationException("can't coerce " +
                    constant + " to " + type);
        }
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:34,代码来源:CfTranslator.java


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