本文整理汇总了Java中org.eclipse.xtext.xbase.lib.IterableExtensions.toList方法的典型用法代码示例。如果您正苦于以下问题:Java IterableExtensions.toList方法的具体用法?Java IterableExtensions.toList怎么用?Java IterableExtensions.toList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xbase.lib.IterableExtensions
的用法示例。
在下文中一共展示了IterableExtensions.toList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialHiddenTokens
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public List<String> initialHiddenTokens(final Grammar it) {
List<String> _xblockexpression = null;
{
boolean _isDefinesHiddenTokens = it.isDefinesHiddenTokens();
if (_isDefinesHiddenTokens) {
final Function1<AbstractRule, String> _function = (AbstractRule it_1) -> {
return this.ruleName(it_1);
};
return IterableExtensions.<String>toList(ListExtensions.<AbstractRule, String>map(it.getHiddenTokens(), _function));
}
int _size = it.getUsedGrammars().size();
boolean _equals = (_size == 1);
if (_equals) {
return this.initialHiddenTokens(IterableExtensions.<Grammar>head(it.getUsedGrammars()));
}
_xblockexpression = CollectionLiterals.<String>emptyList();
}
return _xblockexpression;
}
示例2: allAssignedClassifiers
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
private static void allAssignedClassifiers(final EClass eClazz, final Collection<EClassifier> acceptor) {
final Function1<EStructuralFeature, Boolean> _function = (EStructuralFeature f) -> {
return Boolean.valueOf(Ecore2XtextExtensions.needsAssignment(f));
};
final Function1<EStructuralFeature, EClassifier> _function_1 = (EStructuralFeature it) -> {
return it.getEType();
};
final List<EClassifier> classifiers = IterableExtensions.<EClassifier>toList(IterableExtensions.<EStructuralFeature, EClassifier>map(IterableExtensions.<EStructuralFeature>filter(eClazz.getEAllStructuralFeatures(), _function), _function_1));
Iterable<EClass> _subClasses = Ecore2XtextExtensions.subClasses(eClazz);
Iterables.<EClassifier>addAll(classifiers, _subClasses);
classifiers.removeAll(acceptor);
boolean _isEmpty = classifiers.isEmpty();
if (_isEmpty) {
return;
} else {
Iterables.<EClassifier>addAll(acceptor, classifiers);
final Consumer<EClass> _function_2 = (EClass c) -> {
Ecore2XtextExtensions.allAssignedClassifiers(c, acceptor);
};
Iterables.<EClass>filter(classifiers, EClass.class).forEach(_function_2);
}
}
示例3: getSymbols
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public List<? extends SymbolInformation> getSymbols(final XtextResource resource, final CancelIndicator cancelIndicator) {
final LinkedHashMap<EObject, SymbolInformation> symbols = CollectionLiterals.<EObject, SymbolInformation>newLinkedHashMap();
final TreeIterator<Object> contents = EcoreUtil.<Object>getAllProperContents(resource, true);
while (contents.hasNext()) {
{
this.operationCanceledManager.checkCanceled(cancelIndicator);
Object _next = contents.next();
final EObject obj = ((EObject) _next);
final SymbolInformation symbol = this.createSymbol(obj);
if ((symbol != null)) {
symbols.put(obj, symbol);
final EObject container = this.getContainer(obj);
final SymbolInformation containerSymbol = symbols.get(container);
String _name = null;
if (containerSymbol!=null) {
_name=containerSymbol.getName();
}
symbol.setContainerName(_name);
}
}
}
return IterableExtensions.<SymbolInformation>toList(symbols.values());
}
示例4: getOwnedMembers
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<N4MemberDeclaration> getOwnedMembers() {
final Function1<N4MemberDeclaration, Boolean> _function = new Function1<N4MemberDeclaration, Boolean>() {
public Boolean apply(final N4MemberDeclaration it) {
boolean _isCallableConstructor = it.isCallableConstructor();
return Boolean.valueOf((!_isCallableConstructor));
}
};
final Iterable<N4MemberDeclaration> methods = IterableExtensions.<N4MemberDeclaration>filter(Iterables.<N4MemberDeclaration>filter(this.getOwnedMembersRaw(), N4MemberDeclaration.class), _function);
List<N4MemberDeclaration> _list = IterableExtensions.<N4MemberDeclaration>toList(methods);
return new BasicEList<N4MemberDeclaration>(_list);
}
示例5: getOwnedMethods
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<N4MethodDeclaration> getOwnedMethods() {
final Function1<N4MethodDeclaration, Boolean> _function = new Function1<N4MethodDeclaration, Boolean>() {
public Boolean apply(final N4MethodDeclaration it) {
return Boolean.valueOf(((!it.isConstructor()) && (!it.isCallableConstructor())));
}
};
final Iterable<N4MethodDeclaration> methods = IterableExtensions.<N4MethodDeclaration>filter(Iterables.<N4MethodDeclaration>filter(this.getOwnedMembersRaw(), N4MethodDeclaration.class), _function);
List<N4MethodDeclaration> _list = IterableExtensions.<N4MethodDeclaration>toList(methods);
return new BasicEList<N4MethodDeclaration>(_list);
}
示例6: withDetails
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected void withDetails(final IResolvedOperation operation, final IOverrideCheckResult.OverrideCheckDetails... details) {
final Consumer<JvmOperation> _function = (JvmOperation it) -> {
final IOverrideCheckResult checkResult = operation.isOverridingOrImplementing(it);
final EnumSet<IOverrideCheckResult.OverrideCheckDetails> actual = checkResult.getDetails();
StringConcatenation _builder = new StringConcatenation();
_builder.append("Failed: ");
_builder.append(actual);
_builder.append(".containsAll(");
List<IOverrideCheckResult.OverrideCheckDetails> _list = IterableExtensions.<IOverrideCheckResult.OverrideCheckDetails>toList(((Iterable<IOverrideCheckResult.OverrideCheckDetails>)Conversions.doWrapArray(details)));
_builder.append(_list);
_builder.append(")");
Assert.assertTrue(_builder.toString(), actual.containsAll(((Collection<?>)Conversions.doWrapArray(details))));
};
operation.getOverriddenAndImplementedMethodCandidates().forEach(_function);
}
示例7: parseTags
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public static List<TaskTag> parseTags(final String names, final String priorities) {
final Splitter splitter = Splitter.on(",").omitEmptyStrings().trimResults();
final List<String> tags = IterableExtensions.<String>toList(splitter.split(names));
final List<String> prios = IterableExtensions.<String>toList(splitter.split(priorities));
final ArrayList<TaskTag> elements = CollectionLiterals.<TaskTag>newArrayList();
int _size = tags.size();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
for (final Integer i : _doubleDotLessThan) {
TaskTag _taskTag = new TaskTag();
final Procedure1<TaskTag> _function = (TaskTag it) -> {
it.setName(tags.get((i).intValue()));
Priority _xifexpression = null;
int _size_1 = prios.size();
boolean _greaterEqualsThan = (_size_1 >= (i).intValue());
if (_greaterEqualsThan) {
Priority _xtrycatchfinallyexpression = null;
try {
_xtrycatchfinallyexpression = Priority.valueOf(prios.get((i).intValue()));
} catch (final Throwable _t) {
if (_t instanceof IllegalArgumentException) {
_xtrycatchfinallyexpression = Priority.NORMAL;
} else {
throw Exceptions.sneakyThrow(_t);
}
}
_xifexpression = _xtrycatchfinallyexpression;
} else {
_xifexpression = Priority.NORMAL;
}
it.setPriority(_xifexpression);
};
TaskTag _doubleArrow = ObjectExtensions.<TaskTag>operator_doubleArrow(_taskTag, _function);
elements.add(_doubleArrow);
}
return elements;
}
示例8: getDeltasForChangedResources
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected List<IResourceDescription.Delta> getDeltasForChangedResources(final Iterable<URI> affectedUris, final ResourceDescriptionsData oldIndex, @Extension final BuildContext context) {
try {
this.compilerPhases.setIndexing(context.getResourceSet(), true);
final Function1<Resource, IResourceDescription.Delta> _function = (Resource it) -> {
return this.addToIndex(it, true, oldIndex, context);
};
return IterableExtensions.<IResourceDescription.Delta>toList(context.<IResourceDescription.Delta>executeClustered(affectedUris, _function));
} finally {
this.compilerPhases.setIndexing(context.getResourceSet(), false);
}
}
示例9: getPackageName
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
private static String getPackageName(final String qualifiedName, final boolean strict) {
final List<String> segments = IterableExtensions.<String>toList(Splitter.on(".").split(qualifiedName));
int _size = segments.size();
boolean _equals = (_size == 1);
if (_equals) {
return "";
}
if (strict) {
int _length = ((Object[])Conversions.unwrapArray(segments, Object.class)).length;
int _minus = (_length - 1);
final List<String> packageSegments = segments.subList(0, _minus);
final Function1<String, Boolean> _function = (String it) -> {
return Boolean.valueOf(Character.isUpperCase(it.charAt(0)));
};
boolean _isEmpty = IterableExtensions.isEmpty(IterableExtensions.<String>filter(packageSegments, _function));
boolean _not = (!_isEmpty);
if (_not) {
throw new IllegalArgumentException((("Cannot determine the package name of \'" + qualifiedName) + "\'. Please use the TypeReference(packageName, className) constructor"));
}
return IterableExtensions.join(packageSegments, ".");
} else {
int _length_1 = ((Object[])Conversions.unwrapArray(segments, Object.class)).length;
int _minus_1 = (_length_1 - 1);
List<String> packageSegments_1 = segments.subList(0, _minus_1);
while ((!packageSegments_1.isEmpty())) {
boolean _isUpperCase = Character.isUpperCase(IterableExtensions.<String>last(packageSegments_1).charAt(0));
if (_isUpperCase) {
final List<String> _converted_packageSegments_1 = (List<String>)packageSegments_1;
int _length_2 = ((Object[])Conversions.unwrapArray(_converted_packageSegments_1, Object.class)).length;
int _minus_2 = (_length_2 - 1);
packageSegments_1 = packageSegments_1.subList(0, _minus_2);
} else {
return IterableExtensions.join(packageSegments_1, ".");
}
}
return "";
}
}
示例10: _contentsAsList
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected List<AbstractElement> _contentsAsList(final UnorderedGroup it) {
ArrayList<AbstractElement> _xblockexpression = null;
{
final ArrayList<AbstractElement> result = CollectionLiterals.<AbstractElement>newArrayList(it);
final Function1<AbstractElement, List<AbstractElement>> _function = (AbstractElement it_1) -> {
return this.contentsAsList(it_1);
};
List<AbstractElement> _list = IterableExtensions.<AbstractElement>toList(Iterables.<AbstractElement>concat(ListExtensions.<AbstractElement, List<AbstractElement>>map(it.getElements(), _function)));
Iterables.<AbstractElement>addAll(result, _list);
_xblockexpression = result;
}
return _xblockexpression;
}
示例11: inlinedFeatures
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public static Iterable<EStructuralFeature> inlinedFeatures(final EClass it) {
final Function1<EStructuralFeature, Boolean> _function = (EStructuralFeature f) -> {
return Boolean.valueOf(Ecore2XtextExtensions.needsAssignment(f));
};
final List<EStructuralFeature> features = IterableExtensions.<EStructuralFeature>toList(IterableExtensions.<EStructuralFeature>filter(it.getEAllStructuralFeatures(), _function));
features.remove(Ecore2XtextExtensions.idAttribute(it));
features.removeAll(IterableExtensions.<EStructuralFeature>toList(Ecore2XtextExtensions.prefixFeatures(it)));
return features;
}
示例12: getReferences
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public List<? extends Location> getReferences(final Document document, final XtextResource resource, final ReferenceParams params, final IReferenceFinder.IResourceAccess resourceAccess, final IResourceDescriptions indexData, final CancelIndicator cancelIndicator) {
final int offset = document.getOffSet(params.getPosition());
List<? extends Location> _xifexpression = null;
boolean _isIncludeDeclaration = params.getContext().isIncludeDeclaration();
if (_isIncludeDeclaration) {
_xifexpression = this.getDefinitions(resource, offset, resourceAccess, cancelIndicator);
} else {
_xifexpression = CollectionLiterals.emptyList();
}
final List<? extends Location> definitions = _xifexpression;
final List<? extends Location> references = this.getReferences(resource, offset, resourceAccess, indexData, cancelIndicator);
final Iterable<Location> result = Iterables.<Location>concat(definitions, references);
return IterableExtensions.<Location>toList(result);
}
示例13: format
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public List<TextEdit> format(final XtextResource resource, final Document document, final int offset, final int length) {
if ((this.formatter2Provider != null)) {
TextRegion _textRegion = new TextRegion(offset, length);
final List<ITextReplacement> replacements = this.format2(resource, _textRegion, null);
final Function1<ITextReplacement, TextEdit> _function = (ITextReplacement r) -> {
return this.toTextEdit(document, r.getReplacementText(), r.getOffset(), r.getLength());
};
return IterableExtensions.<TextEdit>toList(ListExtensions.<ITextReplacement, TextEdit>map(replacements, _function));
} else {
return CollectionLiterals.<TextEdit>newArrayList();
}
}
示例14: getOwnedFields
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<N4FieldDeclaration> getOwnedFields() {
final Iterable<N4FieldDeclaration> fields = Iterables.<N4FieldDeclaration>filter(this.getOwnedMembersRaw(), N4FieldDeclaration.class);
List<N4FieldDeclaration> _list = IterableExtensions.<N4FieldDeclaration>toList(fields);
return new BasicEList<N4FieldDeclaration>(_list);
}
示例15: getOwnedGetters
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<N4GetterDeclaration> getOwnedGetters() {
final Iterable<N4GetterDeclaration> getters = Iterables.<N4GetterDeclaration>filter(this.getOwnedMembersRaw(), N4GetterDeclaration.class);
List<N4GetterDeclaration> _list = IterableExtensions.<N4GetterDeclaration>toList(getters);
return new BasicEList<N4GetterDeclaration>(_list);
}