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


Java SourcePosition.equals方法代码示例

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


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

示例1: make

import com.android.dx.rop.code.SourcePosition; //导入方法依赖的package包/类
/**
 * Extracts and returns the source position information out of an
 * instruction list.
 *
 * @param insns {@code non-null;} instructions to convert
 * @param howMuch how much information should be included; one of the
 * static constants defined by this class
 * @return {@code non-null;} the positions list
 */
public static PositionList make(DalvInsnList insns, int howMuch) {
    switch (howMuch) {
        case NONE: {
            return EMPTY;
        }
        case LINES:
        case IMPORTANT: {
            // Valid.
            break;
        }
        default: {
            throw new IllegalArgumentException("bogus howMuch");
        }
    }

    SourcePosition noInfo = SourcePosition.NO_INFO;
    SourcePosition cur = noInfo;
    int sz = insns.size();
    PositionList.Entry[] arr = new PositionList.Entry[sz];
    boolean lastWasTarget = false;
    int at = 0;

    for (int i = 0; i < sz; i++) {
        DalvInsn insn = insns.get(i);

        if (insn instanceof CodeAddress) {
            lastWasTarget = true;;
            continue;
        }

        SourcePosition pos = insn.getPosition();

        if (pos.equals(noInfo) || pos.sameLine(cur)) {
            continue;
        }

        if ((howMuch == IMPORTANT) && !lastWasTarget) {
            continue;
        }

        cur = pos;
        arr[at] = new PositionList.Entry(insn.getAddress(), pos);
        at++;

        lastWasTarget = false;
    }

    PositionList result = new PositionList(at);
    for (int i = 0; i < at; i++) {
        result.set(i, arr[i]);
    }

    result.setImmutable();
    return result;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:65,代码来源:PositionList.java

示例2: make

import com.android.dx.rop.code.SourcePosition; //导入方法依赖的package包/类
/**
 * Extracts and returns the source position information out of an
 * instruction list.
 *
 * @param insns {@code non-null;} instructions to convert
 * @param howMuch how much information should be included; one of the
 * static constants defined by this class
 * @return {@code non-null;} the positions list
 */
public static PositionList make(DalvInsnList insns, int howMuch) {
    switch (howMuch) {
        case NONE: {
            return EMPTY;
        }
        case LINES:
        case IMPORTANT: {
            // Valid.
            break;
        }
        default: {
            throw new IllegalArgumentException("bogus howMuch");
        }
    }

    SourcePosition noInfo = SourcePosition.NO_INFO;
    SourcePosition cur = noInfo;
    int sz = insns.size();
    Entry[] arr = new Entry[sz];
    boolean lastWasTarget = false;
    int at = 0;

    for (int i = 0; i < sz; i++) {
        DalvInsn insn = insns.get(i);

        if (insn instanceof CodeAddress) {
            lastWasTarget = true;;
            continue;
        }

        SourcePosition pos = insn.getPosition();

        if (pos.equals(noInfo) || pos.sameLine(cur)) {
            continue;
        }

        if ((howMuch == IMPORTANT) && !lastWasTarget) {
            continue;
        }

        cur = pos;
        arr[at] = new Entry(insn.getAddress(), pos);
        at++;

        lastWasTarget = false;
    }

    PositionList result = new PositionList(at);
    for (int i = 0; i < at; i++) {
        result.set(i, arr[i]);
    }

    result.setImmutable();
    return result;
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:65,代码来源:PositionList.java


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