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


Java EList.add方法代码示例

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


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

示例1: findReferences

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@Override
public void findReferences(Predicate<URI> targetURIs, Resource resource, Acceptor acceptor,
		IProgressMonitor monitor) {
	// make sure data is present
	keys.getData((TargetURIs) targetURIs, new SimpleResourceAccess(resource.getResourceSet()));
	EList<EObject> astContents;
	if (resource instanceof N4JSResource) {
		// In case of N4JSResource, we search only in the AST but NOT in TModule tree!
		Script script = (Script) ((N4JSResource) resource).getContents().get(0);
		astContents = new BasicEList<>();
		astContents.add(script);
	} else {
		astContents = resource.getContents();
	}
	for (EObject content : astContents) {
		findReferences(targetURIs, content, acceptor, monitor);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:19,代码来源:ConcreteSyntaxAwareReferenceFinder.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: visit

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@Override
public void visit(ContainerValue containerval, String param) {
    Container container = (Container) containerval.getType();
    EClass containerClass = this.m_typeToEcore.getContainerClass(container);

    EObject containerObject = containerClass.getEPackage()
        .getEFactoryInstance()
        .create(containerClass);
    setElement(containerval, containerObject);
    this.m_eObjects.add(containerObject);

    EStructuralFeature eFeature = containerClass.getEStructuralFeature("value");
    @SuppressWarnings("unchecked") EList<Object> objectList =
        (EList<Object>) containerObject.eGet(eFeature);
    for (Value val : containerval.getValue()) {
        Object eSubValue = getElement(val);
        objectList.add(eSubValue);
    }
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:20,代码来源:InstanceToEcore.java

示例4: addTypeModel

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
@Override
public void addTypeModel(TypeModel typeModel) throws PortException {
    int timer = Timer.start("TM to Ecore");
    this.m_currentTypeModel = typeModel;
    visitTypeModel(typeModel);
    Timer.stop(timer);

    timer = Timer.start("Ecore save");
    Resource typeResource = this.m_ecoreResource.getTypeResource(typeModel.getQualName());
    EList<EObject> contents = typeResource.getContents();

    for (EPackage pkg : this.m_rootPackages) {
        //pkg.setNsPrefix(pkg.getName().toLowerCase());
        //pkg.setNsURI("file://./" + typeModel.getName() + ".ecore#" + pkg.getName().toLowerCase());
        contents.add(pkg);
    }
    Timer.stop(timer);
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:19,代码来源:TypeToEcore.java

示例5: 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

示例6: createNonSimplifiedUnionType

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
/**
 * Creates a new union type with the given elements. The elements are copied if they have a container. The created
 * union type may contain duplicates or nested union types, that is, it is not simplified! Thus, the returned type
 * is expected to be processed further!
 *
 * @see org.eclipse.n4js.typesystem.N4JSTypeSystem#createSimplifiedUnion(List, Resource)
 * @see org.eclipse.n4js.typesystem.TypeSystemHelper#simplify(RuleEnvironment, ComposedTypeRef)
 */
@SuppressWarnings("javadoc")
public static UnionTypeExpression createNonSimplifiedUnionType(Iterable<? extends TypeRef> elements) {
	UnionTypeExpression unionType = TypeRefsFactory.eINSTANCE.createUnionTypeExpression();
	EList<TypeRef> unionElements = unionType.getTypeRefs();

	for (TypeRef e : elements) {
		unionElements.add(TypeUtils.copyIfContained(e));
	}
	return unionType;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:19,代码来源:TypeUtils.java

示例7: createNonSimplifiedIntersectionType

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
/**
 * Creates a new intersection type with the given elements. The elements are copied if they have a container. The
 * created intersection type may contain duplicates or nested intersection types, that is, it is not simplified!
 *
 * @see org.eclipse.n4js.typesystem.N4JSTypeSystem#createSimplifiedIntersection(List, Resource)
 * @see org.eclipse.n4js.typesystem.TypeSystemHelper#simplify(RuleEnvironment, ComposedTypeRef)
 */
@SuppressWarnings("javadoc")
public static IntersectionTypeExpression createNonSimplifiedIntersectionType(Iterable<? extends TypeRef> elements) {
	IntersectionTypeExpression intersectionType = TypeRefsFactory.eINSTANCE.createIntersectionTypeExpression();
	EList<TypeRef> intersectionElements = intersectionType.getTypeRefs();

	for (TypeRef e : elements) {
		intersectionElements.add(TypeUtils.copyIfContained(e));
	}
	return intersectionType;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:18,代码来源:TypeUtils.java

示例8: addProperty

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
protected static void addProperty ( final EList<PropertyEntry> properties, final String key, final String value )
{
    final PropertyEntry pe = RecipeFactory.eINSTANCE.createPropertyEntry ();
    pe.setKey ( key );
    pe.setValue ( value );
    properties.add ( pe );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:RecipeBuilder.java

示例9: getDimensionsInternal

import org.eclipse.emf.common.util.EList; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public EList<SpecificDimension<?>> getDimensionsInternal() {
	final EList<SpecificDimension<?>> result = new org.eclipse.emf.ecore.util.BasicInternalEList<SpecificDimension<?>>(Object.class);
	result.addAll(super.getDimensionsInternal());
	result.add(getStateMachine_currentState_Dimension());
	result.add(getStateMachine_producedString_Dimension());
	result.add(getStateMachine_unprocessedString_Dimension());
	result.add(getStateMachine_consummedString_Dimension());
	return result;
	
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:16,代码来源:TracedStateMachineImpl.java


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