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


Java CstString.getString方法代码示例

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


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

示例1: makeSignature

import com.android.dx.rop.cst.CstString; //导入方法依赖的package包/类
/**
 * Constructs a standard {@code Signature} annotation.
 *
 * @param signature {@code non-null;} the signature string
 * @return {@code non-null;} the annotation
 */
public static Annotation makeSignature(CstString signature) {
    Annotation result = new Annotation(SIGNATURE_TYPE, SYSTEM);

    /*
     * Split the string into pieces that are likely to be common
     * across many signatures and the rest of the file.
     */

    String raw = signature.getString();
    int rawLength = raw.length();
    ArrayList<String> pieces = new ArrayList<String>(20);

    for (int at = 0; at < rawLength; /*at*/) {
        char c = raw.charAt(at);
        int endAt = at + 1;
        if (c == 'L') {
            // Scan to ';' or '<'. Consume ';' but not '<'.
            while (endAt < rawLength) {
                c = raw.charAt(endAt);
                if (c == ';') {
                    endAt++;
                    break;
                } else if (c == '<') {
                    break;
                }
                endAt++;
            }
        } else {
            // Scan to 'L' without consuming it.
            while (endAt < rawLength) {
                c = raw.charAt(endAt);
                if (c == 'L') {
                    break;
                }
                endAt++;
            }
        }

        pieces.add(raw.substring(at, endAt));
        at = endAt;
    }

    int size = pieces.size();
    CstArray.List list = new CstArray.List(size);

    for (int i = 0; i < size; i++) {
        list.set(i, new CstString(pieces.get(i)));
    }

    list.setImmutable();

    result.put(new NameValuePair(VALUE_STRING, new CstArray(list)));
    result.setImmutable();
    return result;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:62,代码来源:AnnotationUtils.java


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