本文整理汇总了Java中org.metaborg.util.iterators.Iterables2.empty方法的典型用法代码示例。如果您正苦于以下问题:Java Iterables2.empty方法的具体用法?Java Iterables2.empty怎么用?Java Iterables2.empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.metaborg.util.iterators.Iterables2
的用法示例。
在下文中一共展示了Iterables2.empty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tracingTermsCompletions
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
private Iterable<IStrategoTerm> tracingTermsCompletions(final int position, Object result,
final ISourceRegion region, final HybridInterpreter runtime, final ITermFactory termFactory,
final String languageName, final Map<IStrategoTerm, Boolean> leftRecursiveTerms,
final Map<IStrategoTerm, Boolean> rightRecursiveTerms) {
if(result == null || region == null) {
return Iterables2.empty();
}
final Collection<IStrategoTerm> parsed = Lists.newLinkedList();
final IStrategoTermVisitor visitor = new AStrategoTermVisitor() {
@Override public boolean visit(IStrategoTerm term) {
final ISourceLocation location = fromTokens(term, runtime, termFactory, position, languageName,
leftRecursiveTerms, rightRecursiveTerms);
if(location != null && location.region().contains(region)) {
parsed.add(term);
return false;
}
return true;
}
};
StrategoTermVisitee.bottomup(visitor, (IStrategoTerm) result);
return parsed;
}
示例2: styleParsed
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public Iterable<IRegionStyle<IStrategoTerm>> styleParsed(ILanguageImpl language,
Iterable<IRegionCategory<IStrategoTerm>> categorization) {
final StylerFacet facet = language.facet(StylerFacet.class);
if(facet == null) {
logger.error("Cannot style input of {}, it does not have a styler facet", language);
// GTODO: throw exception instead
return Iterables2.empty();
}
final List<IRegionStyle<IStrategoTerm>> regionStyles = Lists.newLinkedList();
for(IRegionCategory<IStrategoTerm> regionCategory : categorization) {
final IRegionStyle<IStrategoTerm> regionStyle = style(facet, regionCategory);
if(regionStyle != null) {
regionStyles.add(regionStyle);
}
}
return regionStyles;
}
示例3: toTerms
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
private Iterable<IStrategoTerm> toTerms(IStrategoTerm ast, final ISourceRegion region) {
if(ast == null || region == null) {
return Iterables2.empty();
}
final Collection<IStrategoTerm> parsed = Lists.newLinkedList();
final IStrategoTermVisitor visitor = new AStrategoTermVisitor() {
@Override public boolean visit(IStrategoTerm term) {
final ISourceLocation location = location(term);
if(location != null && location.region().contains(region)) {
parsed.add(term);
return false;
}
return true;
}
};
StrategoTermVisitee.bottomup(visitor, ast);
return parsed;
}
示例4: toTermsWithin
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
private Iterable<IStrategoTerm> toTermsWithin(IStrategoTerm ast, final ISourceRegion region) {
if(ast == null || region == null) {
return Iterables2.empty();
}
final Collection<IStrategoTerm> parsed = Lists.newLinkedList();
final IStrategoTermVisitor visitor = new AStrategoTermVisitor() {
@Override public boolean visit(IStrategoTerm term) {
final ISourceLocation location = location(term);
if(location != null && region.contains(location.region())) {
parsed.add(term);
// no need to check the children, as this term is already within the given region
return false;
}
return true;
}
};
StrategoTermVisitee.topdown(visitor, ast);
return parsed;
}
示例5: find
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public static Iterable<FileObject> find(FileObject base, FileSelector selector) throws FileSystemException {
final FileObject[] files = base.findFiles(selector);
if(files == null) {
return Iterables2.empty();
}
return Iterables2.from(files);
}
示例6: fragments
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public Iterable<IStrategoTerm> fragments(ISpoofaxAnalyzeUnit result, ISourceRegion region) {
if(!result.valid()) {
throw new MetaborgRuntimeException(
"Cannot get fragments for analyze unit " + result + " because it is invalid");
}
if(!result.hasAst()) {
return Iterables2.empty();
}
return toTerms(result.ast(), region);
}
示例7: clearContributions
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public void clearContributions() {
contributesTo = Iterables2.empty();
}
示例8: MissingDependencies
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public MissingDependencies() {
this(Iterables2.<LanguageIdentifier>empty(), Iterables2.<LanguageIdentifier>empty());
}
示例9: includePaths
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public Iterable<FileObject> includePaths(IProject project, String languageName) {
return Iterables2.empty();
}
示例10: openEditors
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public Iterable<IEditor> openEditors() {
return Iterables2.empty();
}
示例11: openEditors
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public Iterable<IEditor> openEditors() {
logger.warn("Using dummy editor registry. "
+ "Bind an actual implementation of IEditorRegistry in your Guice module.");
return Iterables2.empty();
}
示例12: TransformContrib
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public TransformContrib() {
this(true, true, null, null, Iterables2.<IMessage>empty(), -1);
}
示例13: AnalyzeUpdateData
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public AnalyzeUpdateData() {
this(Iterables2.<IMessage>empty());
}
示例14: ParseContrib
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public ParseContrib(IStrategoTerm emptyAst) {
this(true, true, emptyAst, Iterables2.<IMessage>empty(), -1);
}
示例15: AnalyzeContrib
import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public AnalyzeContrib() {
this(true, true, false, null, Iterables2.<IMessage>empty(), -1);
}