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


Java Classifier.getOperations方法代码示例

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


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

示例1: ClassNode

import org.eclipse.uml2.uml.Classifier; //导入方法依赖的package包/类
/**
 * Creates a ClassNode based on the EMF-UML model-element and layout
 * information provided
 * 
 * 
 * @param clazz
 *            the EMF-UML model-element which holds informations of this
 *            diagram element
 * @param id
 *            the layout id of this element
 */
public ClassNode(Classifier clazz, String id) {
	/*
	 * position = layout.getPosition(); width = layout.getWidth(); height =
	 * layout.getHeight(); id = layout.getName();
	 */
	this.id = id;
	name = clazz.getName();
	attributes = new ArrayList<Attribute>();
	// creating attributes
	for (Property attr : clazz.getAttributes()) {
		if (attr.getAssociation() == null) {
			attributes.add(new Attribute(attr));
		}
	}

	operations = new ArrayList<MemberOperation>();
	// creating operations
	for (Operation op : clazz.getOperations()) {
		operations.add(new MemberOperation(op));
	}

	if (clazz.isAbstract()) {
		type = CDNodeType.ABSTRACT_CLASS;
	} else {
		type = CDNodeType.CLASS;
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:39,代码来源:ClassNode.java

示例2: getEntryPointOperation

import org.eclipse.uml2.uml.Classifier; //导入方法依赖的package包/类
public Operation getEntryPointOperation(Package package_) {
    for (NamedElement element : package_.getOwnedMembers()) {
        if (!(element instanceof Classifier))
            continue;
        Classifier classifier = (Classifier) element;
        for (Operation operation : classifier.getOperations())
            if (MDDExtensionUtils.isEntryPoint(operation))
                return operation;
    }
    return null;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:12,代码来源:Repository.java

示例3: getBehavioralFeatures

import org.eclipse.uml2.uml.Classifier; //导入方法依赖的package包/类
public static List<? extends BehavioralFeature> getBehavioralFeatures(Classifier classifier) {
    if (!(classifier instanceof Interface) && !(classifier instanceof Class))
        return classifier.getOperations();
    List<BehavioralFeature> combined = new ArrayList<>(classifier.getOperations());
    EList<Reception> receptions = (classifier instanceof Interface) ? ((Interface) classifier).getOwnedReceptions()
            : ((Class) classifier).getOwnedReceptions();
    combined.addAll(receptions);
    return combined;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:10,代码来源:FeatureUtils.java

示例4: findOperation

import org.eclipse.uml2.uml.Classifier; //导入方法依赖的package包/类
/**
 * Finds an operation in the given classifier.
 * 
 * @param arguments
 *            the arguments to match, or null for name-based matching only
 */
public static Operation findOperation(IRepository repository, Classifier classifier, String operationName,
        List<TypedElement> arguments, ParameterSubstitutionMap substitutions, boolean ignoreCase, boolean recurse) {
    for (Operation operation : classifier.getOperations()) {
        if (isNameMatch(operation, operationName, ignoreCase)
                && (isMatch(repository, operation, arguments, substitutions)))
            return operation;
    }
    if (!recurse)
        return null;
    Operation found;
    final EList<TemplateBinding> templateBindings = classifier.getTemplateBindings();
    if (!templateBindings.isEmpty())
        for (TemplateBinding templateBinding : templateBindings) {
            TemplateSignature signature = templateBinding.getSignature();
            ParameterSubstitutionMap newSubstitutions = new ParameterSubstitutionMap(templateBinding);
            found = findOperation(repository, (Classifier) signature.getTemplate(), operationName, arguments,
                    newSubstitutions, ignoreCase, true);
            if (found != null)
                return found;
        }
    for (Generalization generalization : classifier.getGeneralizations())
        if ((found = findOperation(repository, generalization.getGeneral(), operationName, arguments,
                substitutions, ignoreCase, true)) != null)
            return found;
    // recurse to owning classifier
    for (Namespace owner = (Namespace) classifier.getOwner(); owner instanceof Classifier; owner = (Namespace) owner
            .getOwner())
        if ((found = findOperation(repository, (Classifier) owner, operationName, arguments, substitutions,
                ignoreCase, true)) != null)
            return found;
    // fallback to interfaces realized
    if (classifier instanceof BehavioredClassifier) {
        BehavioredClassifier asBehaviored = (BehavioredClassifier) classifier;
        for (Interface implemented : asBehaviored.getImplementedInterfaces())
            if ((found = findOperation(repository, implemented, operationName, arguments, substitutions,
                    ignoreCase, true)) != null)
                return found;
    }

    return null;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:48,代码来源:FeatureUtils.java


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