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


Java Iterables2.empty方法代码示例

本文整理汇总了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;
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:25,代码来源:JSGLRCompletionService.java

示例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;
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:20,代码来源:StylerService.java

示例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;
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:19,代码来源:TracingService.java

示例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;
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:20,代码来源:TracingService.java

示例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);
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:8,代码来源:ResourceUtils.java

示例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);
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:11,代码来源:TracingService.java

示例7: clearContributions

import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public void clearContributions() {
    contributesTo = Iterables2.empty();
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:4,代码来源:LanguageComponent.java

示例8: MissingDependencies

import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public MissingDependencies() {
    this(Iterables2.<LanguageIdentifier>empty(), Iterables2.<LanguageIdentifier>empty());
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:4,代码来源:MissingDependencies.java

示例9: includePaths

import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public Iterable<FileObject> includePaths(IProject project, String languageName) {
    return Iterables2.empty();
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:4,代码来源:SourcePathProvider.java

示例10: openEditors

import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
@Override public Iterable<IEditor> openEditors() {
    return Iterables2.empty();
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:4,代码来源:NullEditorRegistry.java

示例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();
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:6,代码来源:DummyEditorRegistry.java

示例12: TransformContrib

import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public TransformContrib() {
    this(true, true, null, null, Iterables2.<IMessage>empty(), -1);
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:4,代码来源:TransformContrib.java

示例13: AnalyzeUpdateData

import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public AnalyzeUpdateData() {
    this(Iterables2.<IMessage>empty());
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:4,代码来源:AnalyzeUpdateData.java

示例14: ParseContrib

import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public ParseContrib(IStrategoTerm emptyAst) {
    this(true, true, emptyAst, Iterables2.<IMessage>empty(), -1);
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:4,代码来源:ParseContrib.java

示例15: AnalyzeContrib

import org.metaborg.util.iterators.Iterables2; //导入方法依赖的package包/类
public AnalyzeContrib() {
    this(true, true, false, null, Iterables2.<IMessage>empty(), -1);
}
 
开发者ID:metaborg,项目名称:spoofax,代码行数:4,代码来源:AnalyzeContrib.java


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