/** * Applies {@code procedure} for each element of the given iterator. * The procedure takes the element and a loop counter. If the counter would overflow, {@link Integer#MAX_VALUE} * is returned for all subsequent elements. The first element is at index zero. * * @param iterator * the iterator. May not be <code>null</code>. * @param procedure * the procedure. May not be <code>null</code>. */ public static <T> void forEach(Iterator<T> iterator, Procedure2<? super T, ? super Integer> procedure) { if (procedure == null) throw new NullPointerException("procedure"); int i = 0; while(iterator.hasNext()) { procedure.apply(iterator.next(), i); if (i != Integer.MAX_VALUE) i++; } }
setBody(newOp, it -> bodyBuilder.apply(operation, it));
memberGenerator.apply(it, context);
protected void findTargetDeclarations(final URI sourceDeclarationURI, final IProgressMonitor monitor, final Procedure2<? super IEObjectDescription, ? super IReferenceDescription> acceptor) { final IUnitOfWork<Object, EObject> _function = (EObject sourceDeclaration) -> { Object _xblockexpression = null; { IResourceServiceProvider.Registry _resourceServiceProviderRegistry = this.getResourceServiceProviderRegistry(); final IAcceptor<IReferenceDescription> _function_1 = (IReferenceDescription reference) -> { boolean _filterReference = this.filterReference(reference); if (_filterReference) { IEObjectDescription _findTargetDeclaration = null; if (reference!=null) { _findTargetDeclaration=this.findTargetDeclaration(reference); } final IEObjectDescription targetDeclaration = _findTargetDeclaration; acceptor.apply(targetDeclaration, reference); } }; ReferenceAcceptor _referenceAcceptor = new ReferenceAcceptor(_resourceServiceProviderRegistry, _function_1); this.getReferenceFinder().findAllReferences(sourceDeclaration, _referenceAcceptor, monitor); _xblockexpression = null; } return _xblockexpression; }; this.<Object>readOnly(sourceDeclarationURI, _function); }
protected BuildRequest newBuildRequest(final List<URI> changedFiles, final List<URI> deletedFiles, final List<IResourceDescription.Delta> externalDeltas, final CancelIndicator cancelIndicator) { BuildRequest _buildRequest = new BuildRequest(); final Procedure1<BuildRequest> _function = (BuildRequest it) -> { it.setBaseDir(this.baseDir); ResourceDescriptionsData _copy = this.indexState.getResourceDescriptions().copy(); Source2GeneratedMapping _copy_1 = this.indexState.getFileMappings().copy(); IndexState _indexState = new IndexState(_copy, _copy_1); it.setState(_indexState); it.setResourceSet(this.createFreshResourceSet(it.getState().getResourceDescriptions())); it.setDirtyFiles(changedFiles); it.setDeletedFiles(deletedFiles); it.setExternalDeltas(externalDeltas); final BuildRequest.IPostValidationCallback _function_1 = (URI uri, Iterable<Issue> issues) -> { this.issueAcceptor.apply(uri, issues); return true; }; it.setAfterValidate(_function_1); it.setCancelIndicator(cancelIndicator); }; return ObjectExtensions.<BuildRequest>operator_doubleArrow(_buildRequest, _function); }
protected void findSourceDeclarations(final URI targetDeclarationURI, final IProgressMonitor monitor, final Procedure2<? super IEObjectDescription, ? super IReferenceDescription> acceptor) { final TargetURIs targetURIs = this.collectTargetURIs(targetDeclarationURI); IResourceServiceProvider.Registry _resourceServiceProviderRegistry = this.getResourceServiceProviderRegistry(); final IAcceptor<IReferenceDescription> _function = (IReferenceDescription reference) -> { boolean _filterReference = this.filterReference(reference); if (_filterReference) { IEObjectDescription _findSourceDeclaration = null; if (reference!=null) { _findSourceDeclaration=this.findSourceDeclaration(reference); } final IEObjectDescription sourceDeclaration = _findSourceDeclaration; acceptor.apply(sourceDeclaration, reference); } }; ReferenceAcceptor _referenceAcceptor = new ReferenceAcceptor(_resourceServiceProviderRegistry, _function); this.getReferenceFinder().findAllReferences(targetURIs, this.getResourceAccess(), this.getIndexData(), _referenceAcceptor, monitor); }
/** * Applies {@code procedure} for each element of the given iterator. * The procedure takes the element and a loop counter. If the counter would overflow, {@link Integer#MAX_VALUE} * is returned for all subsequent elements. The first element is at index zero. * * @param iterator * the iterator. May not be <code>null</code>. * @param procedure * the procedure. May not be <code>null</code>. */ public static <T> void forEach(Iterator<T> iterator, Procedure2<? super T, ? super Integer> procedure) { if (procedure == null) throw new NullPointerException("procedure"); int i = 0; while(iterator.hasNext()) { procedure.apply(iterator.next(), i); if (i != Integer.MAX_VALUE) i++; } }
/** * Applies the given {@code procedure} for each {@link java.util.Map.Entry key value pair} of the given {@code map}. * * @param map * the map. May not be <code>null</code>. * @param procedure * the procedure. May not be <code>null</code>. */ public static <K, V> void forEach(Map<K, V> map, Procedure2<? super K, ? super V> procedure) { if (procedure == null) throw new NullPointerException("procedure"); for (Map.Entry<K, V> entry : map.entrySet()) { procedure.apply(entry.getKey(), entry.getValue()); } }
/** * Applies the given {@code procedure} for each {@link java.util.Map.Entry key value pair} of the given {@code map}. * * @param map * the map. May not be <code>null</code>. * @param procedure * the procedure. May not be <code>null</code>. */ public static <K, V> void forEach(Map<K, V> map, Procedure2<? super K, ? super V> procedure) { if (procedure == null) throw new NullPointerException("procedure"); for (Map.Entry<K, V> entry : map.entrySet()) { procedure.apply(entry.getKey(), entry.getValue()); } }
@Override public void apply(final JvmOperation it) { parameterCreator.apply(it, spec); EmfParsleyDslJvmModelInferrer.this._jvmTypesBuilder.setBody(it, spec.getExpression()); } };
@Override public void onError(final String message, final Throwable throwable) { callback.apply(message, throwable); MessageTracer _delegate = this.getDelegate(); if (_delegate!=null) { _delegate.onError(message, throwable); } } });
public void reportProjectIssue(final String message, final String code, final Severity severity) { Issue.IssueImpl _issueImpl = new Issue.IssueImpl(); final Procedure1<Issue.IssueImpl> _function = (Issue.IssueImpl it) -> { it.setMessage(message); it.setCode(code); it.setSeverity(severity); it.setUriToProblem(this.baseDir); }; Issue.IssueImpl _doubleArrow = ObjectExtensions.<Issue.IssueImpl>operator_doubleArrow(_issueImpl, _function); this.issueAcceptor.apply(this.baseDir, Collections.<Issue>unmodifiableList(CollectionLiterals.<Issue>newArrayList(_doubleArrow))); }
@Override public void apply(P2 p) { procedure.apply(argument, p); } };
@Override public void apply(P2 p) { procedure.apply(argument, p); } };