org.eclipse.uml2.uml
Interface CollaborationUse

All Superinterfaces:
Element, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.EObject, NamedElement, org.eclipse.emf.common.notify.Notifier

public interface CollaborationUse
extends NamedElement

A representation of the model object 'Collaboration Use'. A CollaborationUse is used to specify the application of a pattern specified by a Collaboration to a specific situation.

From package UML::StructuredClassifiers.

The following features are supported:

See Also:
UMLPackage.getCollaborationUse()

Field Summary
 
Fields inherited from interface org.eclipse.uml2.uml.NamedElement
SEPARATOR
 
Method Summary
 Dependency createRoleBinding(java.lang.String name)
          Creates a new Dependency, with the specified 'Name', and appends it to the 'Role Binding' containment reference list
 Dependency createRoleBinding(java.lang.String name, org.eclipse.emf.ecore.EClass eClass)
          Creates a new Dependency, with the specified 'Name', and appends it to the 'Role Binding' containment reference list
 Dependency getRoleBinding(java.lang.String name)
          Retrieves the first Dependency with the specified 'Name' from the 'Role Binding' containment reference list
 Dependency getRoleBinding(java.lang.String name, boolean ignoreCase, org.eclipse.emf.ecore.EClass eClass, boolean createOnDemand)
          Retrieves the first Dependency with the specified 'Name' from the 'Role Binding' containment reference list
 org.eclipse.emf.common.util.EList<Dependency> getRoleBindings()
          Returns the value of the 'Role Binding' containment reference list.
 Collaboration getType()
          Returns the value of the 'Type' reference
 void setType(Collaboration value)
          Sets the value of the 'Type' reference
 boolean validateClientElements(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          All the client elements of a roleBinding are in one Classifier and all supplier elements of a roleBinding are in one Collaboration.
 boolean validateConnectors(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          Connectors in a Collaboration typing a CollaborationUse must have corresponding Connectors between elements bound in the context Classifier, and these corresponding Connectors must have the same or more general type than the Collaboration Connectors.
 boolean validateEveryRole(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          Every collaborationRole in the Collaboration is bound within the CollaborationUse.
 
Methods inherited from interface org.eclipse.uml2.uml.NamedElement
allNamespaces, allOwningPackages, createDependency, createNameExpression, createUsage, getClientDependencies, getClientDependency, getClientDependency, getLabel, getLabel, getName, getNameExpression, getNamespace, getQualifiedName, getVisibility, isDistinguishableFrom, isSetName, isSetVisibility, separator, setName, setNameExpression, setVisibility, unsetName, unsetVisibility, validateHasNoQualifiedName, validateHasQualifiedName, validateVisibilityNeedsOwnership
 
Methods inherited from interface org.eclipse.uml2.uml.Element
addKeyword, allOwnedElements, applyStereotype, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedSubstereotype, getAppliedSubstereotypes, getKeywords, getModel, getNearestPackage, getOwnedComments, getOwnedElements, getOwner, getRelationships, getRelationships, getRequiredStereotype, getRequiredStereotypes, getSourceDirectedRelationships, getSourceDirectedRelationships, getStereotypeApplication, getStereotypeApplications, getTargetDirectedRelationships, getTargetDirectedRelationships, getValue, hasKeyword, hasValue, isStereotypeApplicable, isStereotypeApplied, isStereotypeRequired, mustBeOwned, removeKeyword, setValue, unapplyStereotype, validateHasOwner, validateNotOwnSelf
 
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotation, getEAnnotations
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Method Detail

getType

Collaboration getType()
Returns the value of the 'Type' reference. The Collaboration which is used in this CollaborationUse. The Collaboration defines the cooperation between its roles which are mapped to ConnectableElements relating to the Classifier owning the CollaborationUse.

From package UML::StructuredClassifiers.

Returns:
the value of the 'Type' reference.
See Also:
setType(Collaboration), UMLPackage.getCollaborationUse_Type()

setType

void setType(Collaboration value)
Sets the value of the 'Type' reference.

Parameters:
value - the new value of the 'Type' reference.
See Also:
getType()

getRoleBindings

org.eclipse.emf.common.util.EList<Dependency> getRoleBindings()
Returns the value of the 'Role Binding' containment reference list. The list contents are of type Dependency.

This feature subsets the following features:

A mapping between features of the Collaboration and features of the owning Classifier. This mapping indicates which ConnectableElement of the Classifier plays which role(s) in the Collaboration. A ConnectableElement may be bound to multiple roles in the same CollaborationUse (that is, it may play multiple roles).

From package UML::StructuredClassifiers.

Returns:
the value of the 'Role Binding' containment reference list.
See Also:
UMLPackage.getCollaborationUse_RoleBinding()

createRoleBinding

Dependency createRoleBinding(java.lang.String name,
                             org.eclipse.emf.ecore.EClass eClass)
Creates a new Dependency, with the specified 'Name', and appends it to the 'Role Binding' containment reference list.

Parameters:
name - The 'Name' for the new Dependency, or null.
eClass - The Ecore class of the Dependency to create.
Returns:
The new Dependency.
See Also:
getRoleBindings()

createRoleBinding

Dependency createRoleBinding(java.lang.String name)
Creates a new Dependency, with the specified 'Name', and appends it to the 'Role Binding' containment reference list.

Parameters:
name - The 'Name' for the new Dependency, or null.
Returns:
The new Dependency.
See Also:
getRoleBindings()

getRoleBinding

Dependency getRoleBinding(java.lang.String name)
Retrieves the first Dependency with the specified 'Name' from the 'Role Binding' containment reference list.

Parameters:
name - The 'Name' of the Dependency to retrieve, or null.
Returns:
The first Dependency with the specified 'Name', or null.
See Also:
getRoleBindings()

getRoleBinding

Dependency getRoleBinding(java.lang.String name,
                          boolean ignoreCase,
                          org.eclipse.emf.ecore.EClass eClass,
                          boolean createOnDemand)
Retrieves the first Dependency with the specified 'Name' from the 'Role Binding' containment reference list.

Parameters:
name - The 'Name' of the Dependency to retrieve, or null.
ignoreCase - Whether to ignore case in String comparisons.
eClass - The Ecore class of the Dependency to retrieve, or null.
createOnDemand - Whether to create a Dependency on demand if not found.
Returns:
The first Dependency with the specified 'Name', or null.
See Also:
getRoleBindings()

validateClientElements

boolean validateClientElements(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                               java.util.Map<java.lang.Object,java.lang.Object> context)
All the client elements of a roleBinding are in one Classifier and all supplier elements of a roleBinding are in one Collaboration. roleBinding->collect(client)->forAll(ne1, ne2 | ne1.oclIsKindOf(ConnectableElement) and ne2.oclIsKindOf(ConnectableElement) and let ce1 : ConnectableElement = ne1.oclAsType(ConnectableElement), ce2 : ConnectableElement = ne2.oclAsType(ConnectableElement) in ce1.structuredClassifier = ce2.structuredClassifier) and roleBinding->collect(supplier)->forAll(ne1, ne2 | ne1.oclIsKindOf(ConnectableElement) and ne2.oclIsKindOf(ConnectableElement) and let ce1 : ConnectableElement = ne1.oclAsType(ConnectableElement), ce2 : ConnectableElement = ne2.oclAsType(ConnectableElement) in ce1.collaboration = ce2.collaboration)

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateEveryRole

boolean validateEveryRole(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                          java.util.Map<java.lang.Object,java.lang.Object> context)
Every collaborationRole in the Collaboration is bound within the CollaborationUse. type.collaborationRole->forAll(role | roleBinding->exists(rb | rb.supplier->includes(role)))

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateConnectors

boolean validateConnectors(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                           java.util.Map<java.lang.Object,java.lang.Object> context)
Connectors in a Collaboration typing a CollaborationUse must have corresponding Connectors between elements bound in the context Classifier, and these corresponding Connectors must have the same or more general type than the Collaboration Connectors. type.ownedConnector->forAll(connector | let rolesConnectedInCollab : Set(ConnectableElement) = connector.end.role->asSet(), relevantBindings : Set(Dependency) = roleBinding->select(rb | rb.supplier->intersection(rolesConnectedInCollab)->notEmpty()), boundRoles : Set(ConnectableElement) = relevantBindings->collect(client.oclAsType(ConnectableElement))->asSet(), contextClassifier : StructuredClassifier = boundRoles->any(true).structuredClassifier->any(true) in contextClassifier.ownedConnector->exists( correspondingConnector | correspondingConnector.end.role->forAll( role | boundRoles->includes(role) ) and (connector.type->notEmpty() and correspondingConnector.type->notEmpty()) implies connector.type->forAll(conformsTo(correspondingConnector.type)) ) )

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

Copyright 2003, 2014 IBM Corporation, CEA, and others.
All Rights Reserved.