當前位置: 首頁>>代碼示例>>Java>>正文


Java Type.equals方法代碼示例

本文整理匯總了Java中org.objectweb.asm.Type.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java Type.equals方法的具體用法?Java Type.equals怎麽用?Java Type.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.objectweb.asm.Type的用法示例。


在下文中一共展示了Type.equals方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isSubTypeOf

import org.objectweb.asm.Type; //導入方法依賴的package包/類
@Override
protected boolean isSubTypeOf(final BasicValue value,
        final BasicValue expected) {
    Type expectedType = expected.getType();
    Type type = value.getType();
    switch (expectedType.getSort()) {
    case Type.INT:
    case Type.FLOAT:
    case Type.LONG:
    case Type.DOUBLE:
        return type.equals(expectedType);
    case Type.ARRAY:
    case Type.OBJECT:
        if ("Lnull;".equals(type.getDescriptor())) {
            return true;
        } else if (type.getSort() == Type.OBJECT
                || type.getSort() == Type.ARRAY) {
            return isAssignableFrom(expectedType, type);
        } else {
            return false;
        }
    default:
        throw new Error("Internal error");
    }
}
 
開發者ID:ItzSomebody,項目名稱:Spigot-Attribute-Remover,代碼行數:26,代碼來源:SimpleVerifier.java

示例2: getSuperClass

import org.objectweb.asm.Type; //導入方法依賴的package包/類
protected Type getSuperClass(final Type t) {
    if (currentClass != null && t.equals(currentClass)) {
        return currentSuperClass;
    }
    Class<?> c = getClass(t).getSuperclass();
    return c == null ? null : Type.getType(c);
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:8,代碼來源:SimpleVerifier.java

示例3: unbox

import org.objectweb.asm.Type; //導入方法依賴的package包/類
/**
 * Generates unboxing bytecode for the passed type. An {@link Object} is expected to be on the
 * stack when these bytecodes are inserted.
 *
 * ASM takes a short cut when dealing with short/byte types and convert them into int rather
 * than short/byte types. This is not an issue on the jvm nor Android's ART but it is an issue
 * on Dalvik.
 *
 * @param mv the {@link GeneratorAdapter} generating a method implementation.
 * @param type the expected un-boxed type.
 */
public static void unbox(GeneratorAdapter mv, Type type) {
    if (type.equals(Type.SHORT_TYPE)) {
        mv.checkCast(NUMBER_TYPE);
        mv.invokeVirtual(NUMBER_TYPE, SHORT_VALUE);
    } else if (type.equals(Type.BYTE_TYPE)) {
        mv.checkCast(NUMBER_TYPE);
        mv.invokeVirtual(NUMBER_TYPE, BYTE_VALUE);
    } else {
        mv.unbox(type);
    }
}
 
開發者ID:meili,項目名稱:Aceso,代碼行數:23,代碼來源:ByteCodeUtils.java

示例4: unbox

import org.objectweb.asm.Type; //導入方法依賴的package包/類
public static AbstractInsnNode unbox(Class clazz, Type requiredType) {
  if (requiredType.equals(Type.LONG_TYPE)) {
    return BoxedPrimitivesMethods.longValue(clazz);
  } else if (requiredType.equals(Type.INT_TYPE)) {
    return BoxedPrimitivesMethods.intValue(clazz);
  } else if (requiredType.equals(Type.DOUBLE_TYPE)) {
    return BoxedPrimitivesMethods.doubleValue(clazz);
  } else {
    throw new UnsupportedOperationException("Unsupported primitive type: " + requiredType);
  }
}
 
開發者ID:kroepke,項目名稱:luna,代碼行數:12,代碼來源:BoxedPrimitivesMethods.java

示例5: isInterface

import org.objectweb.asm.Type; //導入方法依賴的package包/類
protected boolean isInterface(final Type t) {
    if (currentClass != null && t.equals(currentClass)) {
        return isInterface;
    }
    return getClass(t).isInterface();
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:7,代碼來源:SimpleVerifier.java

示例6: isObj

import org.objectweb.asm.Type; //導入方法依賴的package包/類
@Contract("null -> fail")
private static boolean isObj(Type type) {
    return type.equals(MethodGenerator.OBJECT);
}
 
開發者ID:mikroskeem,項目名稱:Shuriken,代碼行數:5,代碼來源:MethodReflectorFactory.java

示例7: checkCast

import org.objectweb.asm.Type; //導入方法依賴的package包/類
/**
 * Generates the instruction to check that the top stack value is of the
 * given type.
 * 
 * @param type
 *            a class or interface type.
 */
public void checkCast(final Type type) {
    if (!type.equals(OBJECT_TYPE)) {
        typeInsn(Opcodes.CHECKCAST, type);
    }
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:13,代碼來源:GeneratorAdapter.java


注:本文中的org.objectweb.asm.Type.equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。