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


Java IterableExtensions.map方法代码示例

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


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

示例1: initializeContext

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected FileInfo initializeContext(final TextDocumentConfiguration configuration) {
  this.initialize();
  boolean _isEmpty = configuration.getFilesInScope().isEmpty();
  boolean _not = (!_isEmpty);
  if (_not) {
    final Function1<Map.Entry<String, CharSequence>, String> _function = (Map.Entry<String, CharSequence> it) -> {
      return this.writeFile(it.getKey(), it.getValue().toString());
    };
    final Iterable<String> createdFiles = IterableExtensions.<Map.Entry<String, CharSequence>, String>map(configuration.getFilesInScope().entrySet(), _function);
    this.didCreateWatchedFiles(((String[])Conversions.unwrapArray(createdFiles, String.class)));
    String _model = configuration.getModel();
    boolean _tripleEquals = (_model == null);
    if (_tripleEquals) {
      String _head = IterableExtensions.<String>head(createdFiles);
      String _string = IterableExtensions.<Map.Entry<String, CharSequence>>head(configuration.getFilesInScope().entrySet()).getValue().toString();
      return new FileInfo(_head, _string);
    }
  }
  Assert.assertNotNull(configuration.getModel());
  final String filePath = this.writeFile(configuration.getFilePath(), configuration.getModel());
  this.open(filePath, configuration.getModel());
  String _model_1 = configuration.getModel();
  return new FileInfo(filePath, _model_1);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:25,代码来源:AbstractLanguageServerTest.java

示例2: createURLClassLoader

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
private URLClassLoader createURLClassLoader(final Iterable<String> classPathEntries) {
  final Function1<String, URL> _function = (String str) -> {
    try {
      return new File(str).toURI().toURL();
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  };
  final Iterable<URL> classPathUrls = IterableExtensions.<String, URL>map(classPathEntries, _function);
  return new URLClassLoader(((URL[])Conversions.unwrapArray(classPathUrls, URL.class)));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:12,代码来源:StandaloneBuilder.java

示例3: getGeneratedPackagesToValidate

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public Iterable<EPackage> getGeneratedPackagesToValidate() {
  final Function1<GeneratedMetamodel, EPackage> _function = (GeneratedMetamodel it) -> {
    return it.getEPackage();
  };
  return IterableExtensions.<GeneratedMetamodel, EPackage>map(Iterables.<GeneratedMetamodel>filter(this.grammar.getMetamodelDeclarations(), GeneratedMetamodel.class), _function);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:7,代码来源:ValidatorFragment.java

示例4: getGeneratedPackagesToValidate

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected Iterable<EPackage> getGeneratedPackagesToValidate() {
  final Function1<GeneratedMetamodel, EPackage> _function = (GeneratedMetamodel it) -> {
    return it.getEPackage();
  };
  return IterableExtensions.<GeneratedMetamodel, EPackage>map(Iterables.<GeneratedMetamodel>filter(this.getGrammar().getMetamodelDeclarations(), GeneratedMetamodel.class), _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:7,代码来源:ValidatorFragment2.java

示例5: getEntries

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public Iterable<ContentAssistEntry> getEntries() {
  final Function1<Pair<Integer, ContentAssistEntry>, ContentAssistEntry> _function = (Pair<Integer, ContentAssistEntry> it) -> {
    return it.getValue();
  };
  return IterableExtensions.<Pair<Integer, ContentAssistEntry>, ContentAssistEntry>map(this.entries, _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:7,代码来源:IdeContentProposalAcceptor.java


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