本文整理汇总了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
}
}
示例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);
}
}
}
}
}