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