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


Java IterableExtensions.exists方法代码示例

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


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

示例1: getGenPackagesForPackages

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected List<GenPackage> getGenPackagesForPackages(final GenModel existingGenModel, final Collection<EPackage> packs) {
  final ArrayList<GenPackage> result = CollectionLiterals.<GenPackage>newArrayList();
  for (final EPackage pkg : packs) {
    final Function1<GenPackage, Boolean> _function = (GenPackage it) -> {
      EPackage _ecorePackage = it.getEcorePackage();
      String _nsURI = null;
      if (_ecorePackage!=null) {
        _nsURI=_ecorePackage.getNsURI();
      }
      String _nsURI_1 = pkg.getNsURI();
      return Boolean.valueOf(Objects.equal(_nsURI, _nsURI_1));
    };
    boolean _exists = IterableExtensions.<GenPackage>exists(existingGenModel.getGenPackages(), _function);
    boolean _not = (!_exists);
    if (_not) {
      result.add(GenModelUtil2.getGenPackage(pkg, existingGenModel.eResource().getResourceSet()));
    }
  }
  final Comparator<GenPackage> _function_1 = (GenPackage o1, GenPackage o2) -> {
    return EcoreUtil.getURI(o1).toString().compareTo(EcoreUtil.getURI(o2).toString());
  };
  Collections.<GenPackage>sort(result, _function_1);
  return result;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:25,代码来源:EMFGeneratorFragment2.java

示例2: getFiles

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
@Override
public Iterable<? extends AbstractFile> getFiles() {
  ArrayList<AbstractFile> _xblockexpression = null;
  {
    final ArrayList<AbstractFile> files = CollectionLiterals.<AbstractFile>newArrayList();
    Iterable<? extends AbstractFile> _files = super.getFiles();
    Iterables.<AbstractFile>addAll(files, _files);
    boolean _isInlined = this.getTestProject().isInlined();
    if (_isInlined) {
      final Function1<AbstractFile, Boolean> _function = (AbstractFile fileFromTestProject) -> {
        final Function1<AbstractFile, Boolean> _function_1 = (AbstractFile it) -> {
          String _relativePath = it.getRelativePath();
          String _relativePath_1 = fileFromTestProject.getRelativePath();
          return Boolean.valueOf(Objects.equal(_relativePath, _relativePath_1));
        };
        boolean _exists = IterableExtensions.<AbstractFile>exists(files, _function_1);
        return Boolean.valueOf((!_exists));
      };
      Iterable<? extends AbstractFile> _filter = IterableExtensions.filter(this.getTestProject().getFiles(), _function);
      Iterables.<AbstractFile>addAll(files, _filter);
    }
    _xblockexpression = files;
  }
  return _xblockexpression;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:26,代码来源:TestedProjectDescriptor.java

示例3: isAbstract

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean isAbstract() {
	return ((((this.eContainer() instanceof N4InterfaceDeclaration) && (this.getBody() == null)) && 
		(!IterableExtensions.<Annotation>exists(this.getAnnotations(), new Function1<Annotation, Boolean>() {
			public Boolean apply(final Annotation it) {
				String _name = it.getName();
				return Boolean.valueOf(Objects.equal(_name, "ProvidesDefaultImplementation"));
			}
		}))) || 
		this.getDeclaredModifiers().contains(N4Modifier.ABSTRACT));
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:16,代码来源:N4GetterDeclarationImpl.java

示例4: isDeclaredFinal

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean isDeclaredFinal() {
	final Function1<Annotation, Boolean> _function = new Function1<Annotation, Boolean>() {
		public Boolean apply(final Annotation it) {
			String _name = it.getName();
			return Boolean.valueOf(Objects.equal(_name, "Final"));
		}
	};
	return IterableExtensions.<Annotation>exists(this.getAnnotations(), _function);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:15,代码来源:N4GetterDeclarationImpl.java

示例5: isAbstract

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean isAbstract() {
	return ((((this.eContainer() instanceof N4InterfaceDeclaration) && (this.getBody() == null)) && 
		(!IterableExtensions.<Annotation>exists(this.getAnnotations(), new Function1<Annotation, Boolean>() {
			public Boolean apply(final Annotation it) {
				String _name = it.getName();
				return Boolean.valueOf(Objects.equal(_name, "ProvidesDefaultImplementation"));
			}
		}))) || this.getDeclaredModifiers().contains(N4Modifier.ABSTRACT));
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:15,代码来源:N4MethodDeclarationImpl.java

示例6: hasPostponedSubstitutionFor

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean hasPostponedSubstitutionFor(final TypeVariable typeVar) {
	final Function1<TypeVariableMapping, Boolean> _function = new Function1<TypeVariableMapping, Boolean>() {
		public Boolean apply(final TypeVariableMapping m) {
			TypeVariable _typeVar = null;
			if (m!=null) {
				_typeVar=m.getTypeVar();
			}
			return Boolean.valueOf((_typeVar == typeVar));
		}
	};
	return IterableExtensions.<TypeVariableMapping>exists(this.getPostponedSubstitutions(), _function);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:18,代码来源:ParameterizedTypeRefStructuralImpl.java

示例7: containsWildcards

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean containsWildcards() {
	return ((this.getTypeArgs().isEmpty() && (!this.getDeclaredType().isGeneric())) || IterableExtensions.<TypeArgument>exists(this.getTypeArgs(), new Function1<TypeArgument, Boolean>() {
		public Boolean apply(final TypeArgument it) {
			return Boolean.valueOf(it.containsWildcards());
		}
	}));
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:ParameterizedTypeRefImpl.java

示例8: containsUnboundTypeVariables

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean containsUnboundTypeVariables() {
	return (((this.getDeclaredType() instanceof TypeVariable) || ((!this.isParameterized()) && this.getDeclaredType().isGeneric())) || IterableExtensions.<TypeArgument>exists(this.getTypeArgs(), new Function1<TypeArgument, Boolean>() {
		public Boolean apply(final TypeArgument it) {
			return Boolean.valueOf(it.containsUnboundTypeVariables());
		}
	}));
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:ParameterizedTypeRefImpl.java

示例9: hasStringArgument

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean hasStringArgument(final String argumentValue) {
	final Function1<TAnnotationStringArgument, Boolean> _function = new Function1<TAnnotationStringArgument, Boolean>() {
		public Boolean apply(final TAnnotationStringArgument it) {
			String _value = it.getValue();
			return Boolean.valueOf(Objects.equal(_value, argumentValue));
		}
	};
	return IterableExtensions.<TAnnotationStringArgument>exists(Iterables.<TAnnotationStringArgument>filter(this.getArgs(), TAnnotationStringArgument.class), _function);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:15,代码来源:TAnnotationImpl.java

示例10: applyRuleSubtypeUnion_Right

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected Result<Boolean> applyRuleSubtypeUnion_Right(final RuleEnvironment G, final RuleApplicationTrace _trace_, final TypeRef S, final UnionTypeExpression U) throws RuleFailedException {
  final Function1<TypeRef, Boolean> _function = (TypeRef T) -> {
    /* G |- S <: T */
    boolean _ruleinvocation = subtypeSucceeded(G, _trace_, S, T);
    return Boolean.valueOf(_ruleinvocation);
  };
  /* U.typeRefs.exists[T| G |- S <: T ] */
  if (!IterableExtensions.<TypeRef>exists(U.getTypeRefs(), _function)) {
    sneakyThrowRuleFailedException("U.typeRefs.exists[T| G |- S <: T ]");
  }
  return new Result<Boolean>(true);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:InternalTypeSystem.java

示例11: applyRuleSubtypeIntersection_Left

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected Result<Boolean> applyRuleSubtypeIntersection_Left(final RuleEnvironment G, final RuleApplicationTrace _trace_, final IntersectionTypeExpression I, final TypeRef S) throws RuleFailedException {
  final Function1<TypeRef, Boolean> _function = (TypeRef T) -> {
    /* G |- T <: S */
    boolean _ruleinvocation = subtypeSucceeded(G, _trace_, T, S);
    return Boolean.valueOf(_ruleinvocation);
  };
  /* I.typeRefs.exists[T| G |- T <: S ] */
  if (!IterableExtensions.<TypeRef>exists(I.getTypeRefs(), _function)) {
    sneakyThrowRuleFailedException("I.typeRefs.exists[T| G |- T <: S ]");
  }
  return new Result<Boolean>(true);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:InternalTypeSystem.java

示例12: hasErrors

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public boolean hasErrors(final EObject element) {
  boolean _xblockexpression = false;
  {
    final IElementIssueProvider issueProvider = this.issueProviderFactory.get(element.eResource());
    final Function1<Issue, Boolean> _function = (Issue it) -> {
      Severity _severity = it.getSeverity();
      return Boolean.valueOf(Objects.equal(_severity, Severity.ERROR));
    };
    _xblockexpression = IterableExtensions.<Issue>exists(issueProvider.getIssues(element), _function);
  }
  return _xblockexpression;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:13,代码来源:ErrorSafeExtensions.java

示例13: isImportDeclarationRequired

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected boolean isImportDeclarationRequired(final ITypeDescriptor typeDesc, final String qualifiedName, final ContentAssistContext context, final XImportSection importSection) {
  return ((!(typeDesc.getName().startsWith("java.lang") && (typeDesc.getName().lastIndexOf(".") == 9))) && ((importSection == null) || (!IterableExtensions.<XImportDeclaration>exists(importSection.getImportDeclarations(), ((Function1<XImportDeclaration, Boolean>) (XImportDeclaration it) -> {
    JvmDeclaredType _importedType = it.getImportedType();
    String _qualifiedName = null;
    if (_importedType!=null) {
      _qualifiedName=_importedType.getQualifiedName();
    }
    return Boolean.valueOf(Objects.equal(_qualifiedName, qualifiedName));
  })))));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:11,代码来源:ClasspathBasedIdeTypesProposalProvider.java

示例14: hasReturnExpression

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public boolean hasReturnExpression(final XExpression expression) {
  boolean _switchResult = false;
  boolean _matched = false;
  if (expression instanceof XReturnExpression) {
    _matched=true;
    _switchResult = true;
  }
  if (!_matched) {
    if (expression instanceof XThrowExpression) {
      _matched=true;
      _switchResult = true;
    }
  }
  if (!_matched) {
    if (expression instanceof XClosure) {
      _matched=true;
      _switchResult = false;
    }
  }
  if (!_matched) {
    final Function1<EObject, Boolean> _function = (EObject content) -> {
      boolean _switchResult_1 = false;
      boolean _matched_1 = false;
      if (content instanceof XExpression) {
        _matched_1=true;
        _switchResult_1 = this.hasReturnExpression(((XExpression)content));
      }
      if (!_matched_1) {
        _switchResult_1 = false;
      }
      return Boolean.valueOf(_switchResult_1);
    };
    _switchResult = IterableExtensions.<EObject>exists(expression.eContents(), _function);
  }
  return _switchResult;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:37,代码来源:AbstractBatchReturnTypeTest.java

示例15: hasGetter

import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public boolean hasGetter(final FieldDeclaration it) {
  final Function1<String, Boolean> _function = new Function1<String, Boolean>() {
    @Override
    public Boolean apply(final String name) {
      MethodDeclaration _findDeclaredMethod = it.getDeclaringType().findDeclaredMethod(name);
      return Boolean.valueOf((_findDeclaredMethod != null));
    }
  };
  return IterableExtensions.<String>exists(this.getPossibleGetterNames(it), _function);
}
 
开发者ID:eclipse,项目名称:xtext-lib,代码行数:11,代码来源:AccessorsProcessor.java


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