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


Java EList.size方法代码示例

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


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

示例1: getIdentifiableElement

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
private IdentifiableElement getIdentifiableElement(IEObjectCoveringRegion arg1) {
	EObject eobj = arg1.getEObject();
	if (eobj instanceof ExportDeclaration) {
		eobj = ((ExportDeclaration) eobj).getExportedElement();
	}
	if (eobj instanceof ExportedVariableStatement) {
		EList<VariableDeclaration> decls = ((ExportedVariableStatement) eobj).getVarDecl();
		if (decls.size() != 1) {
			throw new IllegalStateException("JSDoc for var statements required exactly one declaration.");
		}
		return decls.get(0);
	}
	/** For variables using the new type notation and spec comment after export modifier */
	if (eobj instanceof ExportedVariableDeclaration) {
		return (ExportedVariableDeclaration) eobj;
	}
	/** For variables using the old type notation and spec comment after export modifier */
	if (eobj instanceof TypeRef && eobj.eContainer() instanceof ExportedVariableDeclaration) {
		return (ExportedVariableDeclaration) eobj.eContainer();
	}
	if (eobj instanceof TypeDefiningElement) {
		return ((TypeDefiningElement) eobj).getDefinedType();
	}
	throw new IllegalStateException("No type defining element found at location.");
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:26,代码来源:SpecADocXpectMethod.java

示例2: handleFParameters

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
private void handleFParameters(TMember member, RuleEnvironment G) {
	EList<TFormalParameter> fpars = null;
	if (member instanceof TMethod) {
		TMethod method = (TMethod) member;
		fpars = method.getFpars();
	}
	if (member instanceof TSetter) {
		TSetter setter = (TSetter) member;
		fpars = new BasicEList<>();
		fpars.add(setter.getFpar());
	}
	if (fpars != null) {
		for (int i = 0; i < fpars.size(); i++) {
			TFormalParameter fpar = fpars.get(i);
			if (fParameters.size() <= i) {
				fParameters.add(new ComposedFParInfo());
			}
			ComposedFParInfo fpAggr = fParameters.get(i);
			Pair<TFormalParameter, RuleEnvironment> fpPair = new Pair<>(fpar, G);
			fpAggr.fpSiblings.add(fpPair);
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:24,代码来源:ComposedMemberInfo.java

示例3: createValueArchive

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
private void createValueArchive ( final ValueArchive archive )
{
    final EList<Item> items = archive.getItems ();
    if ( items.isEmpty () )
    {
        return;
    }

    if ( items.size () == 1 )
    {
        // without proxy
        createArchive ( archive, createSource ( archive, items.get ( 0 ), 0 ) );
    }
    else
    {
        // with proxy
        int i = 1; // start with 1 instead of 0, to make a difference when no proxy is used
        final List<String> sources = new LinkedList<> ();
        for ( final Item item : items )
        {
            sources.add ( createSource ( archive, item, i ) );
            i++;
        }
        createArchive ( archive, createProxy ( archive, sources ) );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:ValueArchiveProcessor.java

示例4: visitExtendsFacet

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@Override
public Object visitExtendsFacet(final RAMLParser.ExtendsFacetContext extendsFacet) {
    final String extendsUri = extendsFacet.uri.getText();
    final RamlResource extendsResource = (RamlResource) scope.getResource(extendsUri);
    final EList<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = extendsResource.getErrors();
    if (errors.isEmpty()) {
        final EList<EObject> contents = extendsResource.getContents();
        if (contents.size() != 1) {
            scope.addError("Extended api definition is invalid at {0}", extendsFacet);
        } else {
            final EObject extendsEObject = contents.get(0);
            if (extendsEObject instanceof Api && !(extendsEObject instanceof ApiExtension)) {
                scope.setValue(ModulesPackage.Literals.API_EXTENSION__EXTENDS, extendsEObject, extendsFacet.uri);
            } else {
                scope.addError("Extended api definition has invalid type {0} at {1}",
                        extendsEObject.eClass().getName(), extendsFacet);
            }
        }
    } else {
        scope.getResource().getErrors().addAll(errors); // TODO really necessary?
    }
    return super.visitExtendsFacet(extendsFacet);
}
 
开发者ID:vrapio,项目名称:rest-modeling-framework,代码行数:24,代码来源:ExtensionConstructor.java

示例5: text

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
protected String text(final Policies policies) {
  boolean _isSync = policies.isSync();
  if (_isSync) {
    return "sync";
  }
  boolean _isNocheck = policies.isNocheck();
  if (_isNocheck) {
    return "nocheck";
  }
  final EList<PathGeneratorStopCondition> list = policies.getPathgenerator();
  int _size = list.size();
  boolean _equals = (_size == 0);
  if (_equals) {
    return "?";
  }
  int _size_1 = list.size();
  boolean _equals_1 = (_size_1 == 1);
  if (_equals_1) {
    String _type = list.get(0).getAlgorithmType().getType();
    return (_type + "(...)");
  }
  String _type_1 = list.get(0).getAlgorithmType().getType();
  return (_type_1 + "(...), ...");
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:25,代码来源:DSLPoliciesLabelProvider.java

示例6: initializeQuestions

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
public void initializeQuestions(final Page page) {
  this.questions.clear();
  EList _questions = page.getQuestions();
  int size = _questions.size();
  int i = 0;
  boolean _while = (i < size);
  while (_while) {
    {
      EList _questions_1 = page.getQuestions();
      Object _get = _questions_1.get(i);
      this.questions.add(((Question) _get));
      i = (i + 1);
    }
    _while = (i < size);
  }
}
 
开发者ID:TodorovicNikola,项目名称:SurveyDSL,代码行数:17,代码来源:JQueryGenerator.java

示例7: initializeColumns

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
public void initializeColumns(final Question question) {
  this.columns.clear();
  EList _matrixColumns = question.getMatrixColumns();
  int size = _matrixColumns.size();
  int i = 0;
  boolean _while = (i < size);
  while (_while) {
    {
      EList _matrixColumns_1 = question.getMatrixColumns();
      Object _get = _matrixColumns_1.get(i);
      this.columns.add(((TextValue) _get));
      i = (i + 1);
    }
    _while = (i < size);
  }
}
 
开发者ID:TodorovicNikola,项目名称:SurveyDSL,代码行数:17,代码来源:JQueryGenerator.java

示例8: initializeRows

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
public void initializeRows(final Question question) {
  this.rows.clear();
  EList _matrixRows = question.getMatrixRows();
  int size = _matrixRows.size();
  int i = 0;
  boolean _while = (i < size);
  while (_while) {
    {
      EList _matrixRows_1 = question.getMatrixRows();
      Object _get = _matrixRows_1.get(i);
      this.rows.add(((TextValue) _get));
      i = (i + 1);
    }
    _while = (i < size);
  }
}
 
开发者ID:TodorovicNikola,项目名称:SurveyDSL,代码行数:17,代码来源:JQueryGenerator.java

示例9: initializeMultiTextItems

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
public void initializeMultiTextItems(final Question question) {
  this.multiTextItems.clear();
  EList _multiTextItems = question.getMultiTextItems();
  int size = _multiTextItems.size();
  int i = 0;
  boolean _while = (i < size);
  while (_while) {
    {
      EList _multiTextItems_1 = question.getMultiTextItems();
      Object _get = _multiTextItems_1.get(i);
      this.multiTextItems.add(((MultiTextItem) _get));
      i = (i + 1);
    }
    _while = (i < size);
  }
}
 
开发者ID:TodorovicNikola,项目名称:SurveyDSL,代码行数:17,代码来源:JQueryGenerator.java

示例10: initialzeChoices

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
public void initialzeChoices(final Question question) {
  this.choices.clear();
  EList _choices = question.getChoices();
  int size = _choices.size();
  int i = 0;
  boolean _while = (i < size);
  while (_while) {
    {
      EList _choices_1 = question.getChoices();
      Object _get = _choices_1.get(i);
      this.choices.add(((String) _get));
      i = (i + 1);
    }
    _while = (i < size);
  }
}
 
开发者ID:TodorovicNikola,项目名称:SurveyDSL,代码行数:17,代码来源:JQueryGenerator.java

示例11: createTypeRef

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
/**
 * Same as {@link #createTypeRef(Type, TypingStrategy, TypeArgument...)}, but will create unbounded wildcards as
 * type arguments if fewer type arguments are provided than the number of type parameters of the given declared.
 */
public static ParameterizedTypeRef createTypeRef(Type declaredType, TypingStrategy typingStrategy,
		boolean autoCreateTypeArgs, TypeArgument... typeArgs) {
	if (declaredType == null) {
		return null; // avoid creating a bogus ParameterizedTypeRef with a 'declaredType' property of 'null'
	}
	final ParameterizedTypeRef ref;
	if (declaredType instanceof TFunction) {
		ref = TypeRefsFactory.eINSTANCE.createFunctionTypeRef();
		// } else if (declaredType instanceof TStructuralType) {
		// throw new IllegalArgumentException("a TStructuralType should not be used as declared type of a TypeRef");
	} else if (typingStrategy != TypingStrategy.DEFAULT && typingStrategy != TypingStrategy.NOMINAL) {
		ref = TypeRefsFactory.eINSTANCE.createParameterizedTypeRefStructural();
	} else {
		ref = TypeRefsFactory.eINSTANCE.createParameterizedTypeRef();
	}
	ref.setDefinedTypingStrategy(typingStrategy);
	ref.setDeclaredType(declaredType);
	final EList<TypeArgument> refTypeArgs = ref.getTypeArgs();
	for (TypeArgument typeArg : typeArgs) {
		refTypeArgs.add(TypeUtils.copyIfContained(typeArg));
	}
	if (autoCreateTypeArgs) {
		final int l = declaredType.getTypeVars().size();
		for (int i = refTypeArgs.size(); i < l; i++) {
			refTypeArgs.add(createWildcard());
		}
	}
	return ref;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:34,代码来源:TypeUtils.java

示例12: buildComplexNode

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
static ComplexNode buildComplexNode(ReentrantASTIterator astpp, Script script) {
	ComplexNode cNode = new ComplexNode(astpp.container(), script);

	Node entryNode = new HelperNode(NodeNames.ENTRY, astpp.pos(), script);
	List<Node> scriptNodes = new LinkedList<>();

	EList<ScriptElement> scriptElems = script.getScriptElements();
	for (int n = 0; n < scriptElems.size(); n++) {
		ScriptElement scriptElem = getScriptElementAt(script, n);
		if (isControlFlowStatement(scriptElem)) {
			Node blockNode = DelegatingNodeFactory.create(astpp, "stmt_" + n, script, (Statement) scriptElem);
			scriptNodes.add(blockNode);
		}
	}

	Node exitNode = new HelperNode(NodeNames.EXIT, astpp.pos(), script);

	cNode.addNode(entryNode);
	for (Node scriptNode : scriptNodes)
		cNode.addNode(scriptNode);
	cNode.addNode(exitNode);

	List<Node> nodes = new LinkedList<>();
	nodes.add(entryNode);
	nodes.addAll(scriptNodes);
	nodes.add(exitNode);
	cNode.connectInternalSucc(nodes);

	cNode.setEntryNode(entryNode);
	cNode.setExitNode(exitNode);

	exitNode.addCatchToken(new CatchToken(ControlFlowType.CatchesAll));

	return cNode;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:36,代码来源:ScriptFactory.java

示例13: processModifiers

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
private void processModifiers(EList<N4Modifier> modifiers) {
	final int len = modifiers.size();
	for (int idx = 0; idx < len; idx++) {
		if (idx > 0) {
			write(' ');
		}
		write(modifiers.get(idx).getName());
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:PrettyPrinterSwitch.java

示例14: getDocumentationNodes

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
/**
 * Returns documentation nodes for N4JS AST and type elements (in which case the method returns the nodes of the
 * corresponding AST element). If the AST element has no documentation nodes itself, but is an exportable element,
 * then the documentation of the export statement is returned if present.
 */
@Override
public List<INode> getDocumentationNodes(EObject object) {
	final EObject astNode = N4JSASTUtils.getCorrespondingASTNode(object);
	if (astNode != null) {
		List<INode> nodes = super.getDocumentationNodes(astNode);
		if (nodes.isEmpty() && astNode instanceof VariableDeclaration) {
			TypeRef typeRef = ((VariableDeclaration) astNode).getDeclaredTypeRef();
			if (typeRef != null) {
				nodes = getDocumentationNodes(typeRef);
			}
		}
		if (nodes.isEmpty()) {
			if (astNode instanceof ExportedVariableDeclaration
					&& astNode.eContainer() instanceof ExportedVariableStatement) {
				EList<VariableDeclaration> decls = ((ExportedVariableStatement) astNode.eContainer()).getVarDecl();
				if (decls.size() == 1) {
					return getDocumentationNodes(astNode.eContainer());
				}
			}
			if (astNode instanceof ExportableElement && astNode.eContainer() instanceof ExportDeclaration) {
				nodes = super.getDocumentationNodes(astNode.eContainer());
			}
		}
		if (nodes.isEmpty()) {
			// failure case, was ASI grabbing the doc?
			// backward search for first non-hidden element, over-stepping if it is a LeafNodeWithSyntaxError from
			// ASI.
			ICompositeNode ptNodeOfASTNode = NodeModelUtils.getNode(astNode);
			LeafNode lNode = searchLeafNodeDocumentation(ptNodeOfASTNode);
			if (lNode != null) {
				return Collections.<INode> singletonList(lNode);
			}
		}
		return nodes;
	}
	return super.getDocumentationNodes(object);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:43,代码来源:N4JSDocumentationProvider.java

示例15: addXmlNsPrefixes

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
private static void addXmlNsPrefixes(SaturnResourceImpl saturnResourceImpl_)
{
  EList<EObject> contents = saturnResourceImpl_.getContents();
  if (contents.size() <= 0) return;
  if (!(contents.get(0) instanceof DocumentRoot)) return;

  DocumentRoot documentRoot = (DocumentRoot) contents.get(0);

  List<BasicEMap.Entry<String, String>> xmlNsList = getXmlNsList();
  for (BasicEMap.Entry<String, String> newEntry : xmlNsList)
  {
    documentRoot.getXMLNSPrefixMap().add(newEntry);
  }
}
 
开发者ID:Morgan-Stanley,项目名称:Saturn,代码行数:15,代码来源:SaturnDocLoadSaveUtil.java


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