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


Java ListBuffer.contains方法代码示例

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


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

示例1: addAllClasses

import com.sun.tools.javac.util.ListBuffer; //导入方法依赖的package包/类
/**
 * Adds all inner classes of this class, and their
 * inner classes recursively, to the list l.
 */
void addAllClasses(ListBuffer<ClassDocImpl> l, boolean filtered) {
    try {
        if (isSynthetic()) return;
        // sometimes synthetic classes are not marked synthetic
        if (!JavadocTool.isValidClassName(tsym.name.toString())) return;
        if (filtered && !env.shouldDocument(tsym)) return;
        if (l.contains(this)) return;
        l.append(this);
        List<ClassDocImpl> more = List.nil();
        for (Symbol sym : tsym.members().getSymbols(NON_RECURSIVE)) {
            if (sym != null && sym.kind == TYP) {
                ClassSymbol s = (ClassSymbol)sym;
                ClassDocImpl c = env.getClassDoc(s);
                if (c.isSynthetic()) continue;
                if (c != null) more = more.prepend(c);
            }
        }
        // this extra step preserves the ordering from oldjavadoc
        for (; more.nonEmpty(); more=more.tail) {
            more.head.addAllClasses(l, filtered);
        }
    } catch (CompletionFailure e) {
        // quietly ignore completion failures
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:ClassDocImpl.java

示例2: searchSubPackage

import com.sun.tools.javac.util.ListBuffer; //导入方法依赖的package包/类
/**
 * Recursively search all directories in path for subdirectory name.
 * Add all packages found in such a directory to packages list.
 */
private void searchSubPackage(String packageName,
                              ListBuffer<String> packages,
                              List<String> excludedPackages,
                              Collection<File> pathnames) {
    if (excludedPackages.contains(packageName))
        return;

    String packageFilename = packageName.replace('.', File.separatorChar);
    boolean addedPackage = false;
    for (File pathname : pathnames) {
        File f = new File(pathname, packageFilename);
        String filenames[] = f.list();
        // if filenames not null, then found directory
        if (filenames != null) {
            for (String filename : filenames) {
                if (!addedPackage
                        && (isValidJavaSourceFile(filename) ||
                            isValidJavaClassFile(filename))
                        && !packages.contains(packageName)) {
                    packages.append(packageName);
                    addedPackage = true;
                } else if (isValidClassName(filename) &&
                           (new File(f, filename)).isDirectory()) {
                    searchSubPackage(packageName + "." + filename,
                                     packages, excludedPackages, pathnames);
                }
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:JavadocTool.java


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