• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CstBaseMethodRef类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.android.dx.rop.cst.CstBaseMethodRef的典型用法代码示例。如果您正苦于以下问题:Java CstBaseMethodRef类的具体用法?Java CstBaseMethodRef怎么用?Java CstBaseMethodRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CstBaseMethodRef类属于com.android.dx.rop.cst包,在下文中一共展示了CstBaseMethodRef类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: if

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
/**
 * Interns the given constant in the appropriate section of this
 * instance, or do nothing if the given constant isn't the sort
 * that should be interned.
 *
 * @param cst {@code non-null;} constant to possibly intern
 */
/*package*/ void internIfAppropriate(Constant cst) {
    if (cst instanceof CstString) {
        stringIds.intern((CstString) cst);
    } else if (cst instanceof CstType) {
        typeIds.intern((CstType) cst);
    } else if (cst instanceof CstBaseMethodRef) {
        methodIds.intern((CstBaseMethodRef) cst);
    } else if (cst instanceof CstFieldRef) {
        fieldIds.intern((CstFieldRef) cst);
    } else if (cst instanceof CstEnumRef) {
        fieldIds.intern(((CstEnumRef) cst).getFieldRef());
    } else if (cst == null) {
        throw new NullPointerException("cst == null");
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:23,代码来源:DexFile.java


示例2: get

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public IndexedItem get(Constant cst) {
    if (cst == null) {
        throw new NullPointerException("cst == null");
    }

    throwIfNotPrepared();

    IndexedItem result = methodIds.get((CstBaseMethodRef) cst);

    if (result == null) {
        throw new IllegalArgumentException("not found");
    }

    return result;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:18,代码来源:MethodIdsSection.java


示例3: intern

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
/**
 * Interns an element into this instance.
 *
 * @param method {@code non-null;} the reference to intern
 * @return {@code non-null;} the interned reference
 */
public synchronized MethodIdItem intern(CstBaseMethodRef method) {
    if (method == null) {
        throw new NullPointerException("method == null");
    }

    throwIfPrepared();

    MethodIdItem result = methodIds.get(method);

    if (result == null) {
        result = new MethodIdItem(method);
        methodIds.put(method, result);
    }

    return result;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:23,代码来源:MethodIdsSection.java


示例4: indexOf

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
/**
 * Gets the index of the given reference, which must have been added
 * to this instance.
 *
 * @param ref {@code non-null;} the reference to look up
 * @return {@code >= 0;} the reference's index
 */
public int indexOf(CstBaseMethodRef ref) {
    if (ref == null) {
        throw new NullPointerException("ref == null");
    }

    throwIfNotPrepared();

    MethodIdItem item = methodIds.get(ref);

    if (item == null) {
        throw new IllegalArgumentException("not found");
    }

    return item.getIndex();
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:23,代码来源:MethodIdsSection.java


示例5: addDependencies

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
private void addDependencies(DirectClassFile classFile) {
    for (Constant constant : classFile.getConstantPool().getEntries()) {
        if (constant instanceof CstType) {
            checkDescriptor(((CstType) constant).getClassType().getDescriptor());
        } else if (constant instanceof CstFieldRef) {
            checkDescriptor(((CstFieldRef) constant).getType().getDescriptor());
        } else if (constant instanceof CstBaseMethodRef) {
            checkPrototype(((CstBaseMethodRef) constant).getPrototype());
        }
    }
    FieldList fields = classFile.getFields();
    int nbField = fields.size();
    for (int i = 0; i < nbField; i++) {
      checkDescriptor(fields.get(i).getDescriptor().getString());
    }
    MethodList methods = classFile.getMethods();
    int nbMethods = methods.size();
    for (int i = 0; i < nbMethods; i++) {
      checkPrototype(Prototype.intern(methods.get(i).getDescriptor().getString()));
    }
}
 
开发者ID:dodola,项目名称:RocooFix,代码行数:22,代码来源:ClassReferenceListBuilder.java


示例6: intern

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
/**
 * Interns an element into this instance.
 *
 * @param method {@code non-null;} the reference to intern
 * @return {@code non-null;} the interned reference
 */
public MethodIdItem intern(CstBaseMethodRef method) {
    if (method == null) {
        throw new NullPointerException("method == null");
    }

    throwIfPrepared();

    MethodIdItem result = methodIds.get(method);

    if (result == null) {
        result = new MethodIdItem(method);
        methodIds.put(method, result);
    }

    return result;
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:23,代码来源:MethodIdsSection.java


示例7: addDependencies

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
private void addDependencies(DirectClassFile classFile) {
    for (Constant constant : classFile.getConstantPool().getEntries()) {
        if (constant instanceof CstType) {
            checkDescriptor(((CstType) constant).getClassType().getDescriptor());
        } else if (constant instanceof CstFieldRef) {
            checkDescriptor(((CstFieldRef) constant).getType().getDescriptor());
        } else if (constant instanceof CstBaseMethodRef) {
            checkPrototype(((CstBaseMethodRef) constant).getPrototype());
        }
    }

    FieldList fields = classFile.getFields();
    int nbField = fields.size();
    for (int i = 0; i < nbField; i++) {
      checkDescriptor(fields.get(i).getDescriptor().getString());
    }

    MethodList methods = classFile.getMethods();
    int nbMethods = methods.size();
    for (int i = 0; i < nbMethods; i++) {
      checkPrototype(Prototype.intern(methods.get(i).getDescriptor().getString()));
    }
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:24,代码来源:ClassReferenceListBuilder.java


示例8: getOutsSize

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
/**
 * Gets the size of the outgoing arguments area required by this
 * method. This is equal to the largest argument word count of any
 * method referred to by this instance.
 *
 * @return {@code >= 0;} the required outgoing arguments size
 */
public int getOutsSize() {
    int sz = size();
    int result = 0;

    for (int i = 0; i < sz; i++) {
        DalvInsn insn = (DalvInsn) get0(i);

        if (!(insn instanceof CstInsn)) {
            continue;
        }

        Constant cst = ((CstInsn) insn).getConstant();

        if (!(cst instanceof CstBaseMethodRef)) {
            continue;
        }

        boolean isStatic =
            (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC);
        int count =
            ((CstBaseMethodRef) cst).getParameterWordCount(isStatic);

        if (count > result) {
            result = count;
        }
    }

    return result;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:37,代码来源:DalvInsnList.java


示例9: translate0

import com.android.dx.rop.cst.CstBaseMethodRef; //导入依赖的package包/类
/**
 * Performs the main act of translation. This method is separated
 * from {@link #translate} just to keep things a bit simpler in
 * terms of exception handling.
 *
 * @param cf {@code non-null;} the class file
 * @param bytes {@code non-null;} contents of the file
 * @param cfOptions options for class translation
 * @param dexOptions options for dex output
 * @param dexFile {@code non-null;} dex output
 * @return {@code non-null;} the translated class
 */
private static ClassDefItem translate0(DirectClassFile cf, byte[] bytes,
        CfOptions cfOptions, DexOptions dexOptions, DexFile dexFile) {

    OptimizerOptions.loadOptimizeLists(cfOptions.optimizeListFile,
            cfOptions.dontOptimizeListFile);

    // Build up a class to output.

    CstType thisClass = cf.getThisClass();
    int classAccessFlags = cf.getAccessFlags() & ~AccessFlags.ACC_SUPER;
    CstString sourceFile = (cfOptions.positionInfo == PositionList.NONE) ? null :
        cf.getSourceFile();
    ClassDefItem out =
        new ClassDefItem(thisClass, classAccessFlags,
                cf.getSuperclass(), cf.getInterfaces(), sourceFile);

    Annotations classAnnotations =
        AttributeTranslator.getClassAnnotations(cf, cfOptions);
    if (classAnnotations.size() != 0) {
        out.setClassAnnotations(classAnnotations, dexFile);
    }

    FieldIdsSection fieldIdsSection = dexFile.getFieldIds();
    MethodIdsSection methodIdsSection = dexFile.getMethodIds();
    processFields(cf, out, dexFile);
    processMethods(cf, cfOptions, dexOptions, out, dexFile);

    // intern constant pool method, field and type references
    ConstantPool constantPool = cf.getConstantPool();
    int constantPoolSize = constantPool.size();

    for (int i = 0; i < constantPoolSize; i++) {
        Constant constant = constantPool.getOrNull(i);
        if (constant instanceof CstMethodRef) {
            methodIdsSection.intern((CstBaseMethodRef) constant);
        } else if (constant instanceof CstInterfaceMethodRef) {
            methodIdsSection.intern(((CstInterfaceMethodRef) constant).toMethodRef());
        } else if (constant instanceof CstFieldRef) {
            fieldIdsSection.intern((CstFieldRef) constant);
        } else if (constant instanceof CstEnumRef) {
            fieldIdsSection.intern(((CstEnumRef) constant).getFieldRef());
        }
    }

    return out;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:59,代码来源:CfTranslator.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ParserConfig类代码示例发布时间:2022-05-23
下一篇:
Java CacheDirectiveInfoExpirationProto类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap