• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java CollectionExtensions类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.eclipse.xtext.xbase.lib.CollectionExtensions的典型用法代码示例。如果您正苦于以下问题:Java CollectionExtensions类的具体用法?Java CollectionExtensions怎么用?Java CollectionExtensions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

CollectionExtensions类属于org.eclipse.xtext.xbase.lib包,在下文中一共展示了CollectionExtensions类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getExtensionClasses

点赞 3

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
protected List<Class<?>> getExtensionClasses() {
	return Lists.<Class<?>> newArrayList(
		ArrayExtensions.class,
		BigDecimalExtensions.class,
		BigIntegerExtensions.class,
		BooleanExtensions.class,
		ByteExtensions.class,
		CharacterExtensions.class,
		CollectionExtensions.class,
		ComparableExtensions.class,
		DoubleExtensions.class,
		FloatExtensions.class,
		FunctionExtensions.class,
		IntegerExtensions.class,
		IterableExtensions.class,
		IteratorExtensions.class,
		ListExtensions.class,
		LongExtensions.class,
		MapExtensions.class,
		ObjectExtensions.class,
		ProcedureExtensions.class,
		ShortExtensions.class,
		StringExtensions.class);
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:25,
代码来源:ImplicitlyImportedFeatures.java

示例2: generateManifestRt

点赞 3

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
private void generateManifestRt(final LanguageConfig config1, final XpandExecutionContext ctx) {
  ManifestAccess _manifest = this.getProjectConfig().getRuntime().getManifest();
  boolean _tripleNotEquals = (_manifest != null);
  if (_tripleNotEquals) {
    final String[] exported = this.fragment.getExportedPackagesRt(config1.getGrammar());
    if ((exported != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getRuntime().getManifest().getExportedPackages(), exported);
    }
    final String[] required = this.fragment.getRequiredBundlesRt(config1.getGrammar());
    if ((required != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getRuntime().getManifest().getRequiredBundles(), required);
    }
    final String[] imported = this.fragment.getImportedPackagesRt(config1.getGrammar());
    if ((imported != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getRuntime().getManifest().getImportedPackages(), imported);
    }
  }
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:19,
代码来源:FragmentAdapter.java

示例3: generateManifestUi

点赞 3

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
private void generateManifestUi(final LanguageConfig config1, final XpandExecutionContext ctx) {
  ManifestAccess _manifest = this.getProjectConfig().getEclipsePlugin().getManifest();
  boolean _tripleNotEquals = (_manifest != null);
  if (_tripleNotEquals) {
    final String[] exported = this.fragment.getExportedPackagesUi(config1.getGrammar());
    if ((exported != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getEclipsePlugin().getManifest().getExportedPackages(), exported);
    }
    final String[] required = this.fragment.getRequiredBundlesUi(config1.getGrammar());
    if ((required != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getEclipsePlugin().getManifest().getRequiredBundles(), required);
    }
    final String[] imported = this.fragment.getImportedPackagesUi(config1.getGrammar());
    if ((imported != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getEclipsePlugin().getManifest().getImportedPackages(), imported);
    }
  }
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:19,
代码来源:FragmentAdapter.java

示例4: generateManifestIde

点赞 3

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
private void generateManifestIde(final LanguageConfig config1, final XpandExecutionContext ctx) {
  if (((this.fragment instanceof IGeneratorFragmentExtension3) && (this.getProjectConfig().getGenericIde().getManifest() != null))) {
    final IGeneratorFragmentExtension3 fr = ((IGeneratorFragmentExtension3) this.fragment);
    final String[] exported = fr.getExportedPackagesIde(config1.getGrammar());
    if ((exported != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getGenericIde().getManifest().getExportedPackages(), exported);
    }
    final String[] required = fr.getRequiredBundlesIde(config1.getGrammar());
    if ((required != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getGenericIde().getManifest().getRequiredBundles(), required);
    }
    final String[] imported = fr.getImportedPackagesIde(config1.getGrammar());
    if ((imported != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getGenericIde().getManifest().getImportedPackages(), imported);
    }
  }
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:18,
代码来源:FragmentAdapter.java

示例5: generateManifestTests

点赞 3

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
private void generateManifestTests(final LanguageConfig config1, final XpandExecutionContext ctx) {
  if (((this.fragment instanceof IGeneratorFragmentExtension) && (this.getProjectConfig().getRuntimeTest().getManifest() != null))) {
    final IGeneratorFragmentExtension fr = ((IGeneratorFragmentExtension) this.fragment);
    final String[] exported = fr.getExportedPackagesTests(config1.getGrammar());
    if ((exported != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getRuntimeTest().getManifest().getExportedPackages(), exported);
    }
    final String[] required = fr.getRequiredBundlesTests(config1.getGrammar());
    if ((required != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getRuntimeTest().getManifest().getRequiredBundles(), required);
    }
    final String[] imported = fr.getImportedPackagesTests(config1.getGrammar());
    if ((imported != null)) {
      CollectionExtensions.<String>addAll(this.getProjectConfig().getRuntimeTest().getManifest().getImportedPackages(), imported);
    }
  }
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:18,
代码来源:FragmentAdapter.java

示例6: generate

点赞 2

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
@Override
public void generate() {
  if ((this.onlyEnabledIfGrammarIsUsed.get() && (!this.xbaseUsageDetector.inheritsXtype(this.getLanguage().getGrammar())))) {
    return;
  }
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef(IGlobalScopeProvider.class), 
    TypeReference.typeRef("org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider")).contributeTo(this.getLanguage().getRuntimeGenModule());
  GuiceModuleAccess _runtimeGenModule = this.getLanguage().getRuntimeGenModule();
  _runtimeGenModule.setSuperClass(TypeReference.typeRef("org.eclipse.xtext.common.types.DefaultCommonTypesRuntimeModule"));
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher"), 
    TypeReference.typeRef("org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher")).contributeTo(this.getLanguage().getEclipsePluginGenModule());
  GuiceModuleAccess _eclipsePluginGenModule = this.getLanguage().getEclipsePluginGenModule();
  _eclipsePluginGenModule.setSuperClass(TypeReference.typeRef("org.eclipse.xtext.common.types.ui.DefaultCommonTypesUiModule"));
  ManifestAccess _manifest = this.getProjectConfig().getRuntime().getManifest();
  boolean _tripleNotEquals = (_manifest != null);
  if (_tripleNotEquals) {
    CollectionExtensions.<String>addAll(this.getProjectConfig().getRuntime().getManifest().getRequiredBundles(), 
      "org.eclipse.xtext.common.types", 
      "org.objectweb.asm;bundle-version=\"[5.0.1,6.0.0)\";resolution:=optional");
  }
  ManifestAccess _manifest_1 = this.getProjectConfig().getRuntimeTest().getManifest();
  boolean _tripleNotEquals_1 = (_manifest_1 != null);
  if (_tripleNotEquals_1) {
    this.getProjectConfig().getRuntimeTest().getManifest().getRequiredBundles().add(
      "org.objectweb.asm;bundle-version=\"[5.0.1,6.0.0)\";resolution:=optional");
  }
  ManifestAccess _manifest_2 = this.getProjectConfig().getEclipsePlugin().getManifest();
  boolean _tripleNotEquals_2 = (_manifest_2 != null);
  if (_tripleNotEquals_2) {
    this.getProjectConfig().getEclipsePlugin().getManifest().getRequiredBundles().add(
      "org.eclipse.xtext.common.types.ui");
  }
}
 

开发者ID:eclipse,
项目名称:xtext-core,
代码行数:34,
代码来源:TypesGeneratorFragment2.java

示例7: RngColor

点赞 2

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
public String RngColor() {
  Random _random = new Random();
  Random rand = _random;
  ArrayList<String> _arrayList = new ArrayList<String>();
  ArrayList<String> colors = _arrayList;
  CollectionExtensions.<String>addAll(colors, 
    "red", 
    "blue", 
    "green", 
    "yellow", 
    "pink", 
    "orange", 
    "silver", 
    "black", 
    "azure", 
    "aqua", 
    "coral", 
    "aqua", 
    "brown", 
    "gold", 
    "gray", 
    "navy", 
    "violet", 
    "darkblue", 
    "blueviolet", 
    "crimson");
  int colornum = rand.nextInt(19);
  return colors.get(colornum);
}
 

开发者ID:niksavis,
项目名称:mm-dsl,
代码行数:30,
代码来源:MMDSLGenerator.java

示例8: getStates

点赞 2

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
private void getStates(final IStateMachine m) {
  final Function1<IVertex, Boolean> _function = (IVertex s) -> {
    return Boolean.valueOf((!((s instanceof IPseudostate) || (s instanceof IFinalState))));
  };
  Iterable<IVertex> _filter = IterableExtensions.<IVertex>filter(((Iterable<IVertex>)Conversions.doWrapArray(m.getVertexes())), _function);
  final IState[] substates = ((IState[]) ((IState[])Conversions.unwrapArray(_filter, IState.class)));
  CollectionExtensions.<IState>addAll(this.allStates, substates);
  final Consumer<IState> _function_1 = (IState sub) -> {
    this.getStates(sub);
  };
  ((List<IState>)Conversions.doWrapArray(substates)).forEach(_function_1);
}
 

开发者ID:s-hosoai,
项目名称:astahm2t,
代码行数:13,
代码来源:GeneratorUtils.java

示例9: simpleComputeExtensionClasses

点赞 2

import org.eclipse.xtext.xbase.lib.CollectionExtensions; //导入依赖的package包/类
protected Multimap<Class<?>, Class<?>> simpleComputeExtensionClasses() {
	Multimap<Class<?>, Class<?>> result = ArrayListMultimap.create();
	result.put(String.class, StringExtensions.class);
	result.put(Double.TYPE, DoubleExtensions.class);
	result.put(Float.TYPE, FloatExtensions.class);
	result.put(Long.TYPE, LongExtensions.class);
	result.put(Integer.TYPE, IntegerExtensions.class);
	result.put(Character.TYPE, CharacterExtensions.class);
	result.put(Short.TYPE, ShortExtensions.class);
	result.put(Byte.TYPE, ByteExtensions.class);
	result.put(Boolean.TYPE, BooleanExtensions.class);
	result.put(double[].class, ArrayExtensions.class);
	result.put(float[].class, ArrayExtensions.class);
	result.put(long[].class, ArrayExtensions.class);
	result.put(int[].class, ArrayExtensions.class);
	result.put(char[].class, ArrayExtensions.class);
	result.put(short[].class, ArrayExtensions.class);
	result.put(byte[].class, ArrayExtensions.class);
	result.put(boolean[].class, ArrayExtensions.class);
	result.put(BigInteger.class, BigIntegerExtensions.class);
	result.put(BigDecimal.class, BigDecimalExtensions.class);
	result.put(Comparable.class, ComparableExtensions.class);
	result.put(Object.class, ObjectExtensions.class);
	result.put(List.class, ListExtensions.class);
	result.put(Collection.class, CollectionExtensions.class);
	result.put(Map.class, CollectionExtensions.class);
	result.put(Map.class, MapExtensions.class);
	result.put(Iterable.class, IterableExtensions.class);
	result.put(Iterator.class, IteratorExtensions.class);
	result.put(Functions.Function0.class, FunctionExtensions.class);
	result.put(Functions.Function1.class, FunctionExtensions.class);
	result.put(Functions.Function2.class, FunctionExtensions.class);
	result.put(Functions.Function3.class, FunctionExtensions.class);
	result.put(Functions.Function4.class, FunctionExtensions.class);
	result.put(Functions.Function5.class, FunctionExtensions.class);
	result.put(Functions.Function6.class, FunctionExtensions.class);
	result.put(Procedures.Procedure0.class, ProcedureExtensions.class);
	result.put(Procedures.Procedure1.class, ProcedureExtensions.class);
	result.put(Procedures.Procedure2.class, ProcedureExtensions.class);
	result.put(Procedures.Procedure3.class, ProcedureExtensions.class);
	result.put(Procedures.Procedure4.class, ProcedureExtensions.class);
	result.put(Procedures.Procedure5.class, ProcedureExtensions.class);
	result.put(Procedures.Procedure6.class, ProcedureExtensions.class);
	return result;
}
 

开发者ID:eclipse,
项目名称:xtext-extras,
代码行数:46,
代码来源:StaticImplicitMethodsFeatureForTypeProvider.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)