本文整理汇总了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());
}
}
示例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());
}
}
示例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());
}
}
}