blob: e55aa738ff8b9953fe0d23fabd1855caba5e2229 [file] [log] [blame]
/*
* Copyright (c) 2005, 2016 IBM Corporation, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (CEA) - 327039, 351774, 418466, 451350
* Christian W. Damus (CEA) - 251963
* Kenn Hussey - 535301
*
*/
package org.eclipse.uml2.uml;
import java.util.Map;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Association</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* A link is a tuple of values that refer to typed objects. An Association classifies a set of links, each of which is an instance of the Association. Each value in the link refers to an instance of the type of the corresponding end of the Association.
* <p>From package UML::StructuredClassifiers.</p>
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.uml2.uml.Association#getEndTypes <em>End Type</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Association#isDerived <em>Is Derived</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Association#getMemberEnds <em>Member End</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Association#getOwnedEnds <em>Owned End</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Association#getNavigableOwnedEnds <em>Navigable Owned End</em>}</li>
* </ul>
*
* @see org.eclipse.uml2.uml.UMLPackage#getAssociation()
* @model
* @generated
*/
public interface Association
extends Classifier, Relationship {
/**
* Returns the value of the '<em><b>Is Derived</b></em>' attribute.
* The default value is <code>"false"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Specifies whether the Association is derived from other model elements such as other Associations.
* <p>From package UML::StructuredClassifiers.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Is Derived</em>' attribute.
* @see #setIsDerived(boolean)
* @see org.eclipse.uml2.uml.UMLPackage#getAssociation_IsDerived()
* @model default="false" dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false"
* @generated
*/
boolean isDerived();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Association#isDerived <em>Is Derived</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Is Derived</em>' attribute.
* @see #isDerived()
* @generated
*/
void setIsDerived(boolean value);
/**
* Returns the value of the '<em><b>End Type</b></em>' reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Type}.
* <p>
* This feature subsets the following features:
* </p>
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Relationship#getRelatedElements() <em>Related Element</em>}'</li>
* </ul>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The Classifiers that are used as types of the ends of the Association.
* <p>From package UML::StructuredClassifiers.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>End Type</em>' reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getAssociation_EndType()
* @model required="true" transient="true" changeable="false" volatile="true" derived="true" ordered="false"
* @generated
*/
EList<Type> getEndTypes();
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Type} with the specified '<em><b>Name</b></em>' from the '<em><b>End Type</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Type} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Type} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getEndTypes()
* @generated
*/
Type getEndType(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Type} with the specified '<em><b>Name</b></em>' from the '<em><b>End Type</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Type} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Type} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Type} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getEndTypes()
* @generated
*/
Type getEndType(String name, boolean ignoreCase, EClass eClass);
/**
* Returns the value of the '<em><b>Member End</b></em>' reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Property}.
* It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.Property#getAssociation <em>Association</em>}'.
* <p>
* This feature subsets the following features:
* </p>
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Namespace#getMembers() <em>Member</em>}'</li>
* </ul>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Each end represents participation of instances of the Classifier connected to the end in links of the Association.
* <p>From package UML::StructuredClassifiers.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Member End</em>' reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getAssociation_MemberEnd()
* @see org.eclipse.uml2.uml.Property#getAssociation
* @model opposite="association" lower="2"
* @generated
*/
EList<Property> getMemberEnds();
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Member End</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getMemberEnds()
* @generated
*/
Property getMemberEnd(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Member End</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getMemberEnds()
* @generated
*/
Property getMemberEnd(String name, Type type, boolean ignoreCase,
EClass eClass);
/**
* Returns the value of the '<em><b>Navigable Owned End</b></em>' reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Property}.
* <p>
* This feature subsets the following features:
* </p>
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Association#getOwnedEnds() <em>Owned End</em>}'</li>
* </ul>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The navigable ends that are owned by the Association itself.
* <p>From package UML::StructuredClassifiers.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Navigable Owned End</em>' reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getAssociation_NavigableOwnedEnd()
* @model ordered="false"
* @generated
*/
EList<Property> getNavigableOwnedEnds();
/**
* Creates a new {@link org.eclipse.uml2.uml.Property}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and appends it to the '<em><b>Navigable Owned End</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Property} to create.
* @return The new {@link org.eclipse.uml2.uml.Property}.
* @see #getNavigableOwnedEnds()
* @generated
*/
Property createNavigableOwnedEnd(String name, Type type, EClass eClass);
/**
* Creates a new {@link org.eclipse.uml2.uml.Property}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and appends it to the '<em><b>Navigable Owned End</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Property}.
* @see #getNavigableOwnedEnds()
* @generated
*/
Property createNavigableOwnedEnd(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Navigable Owned End</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getNavigableOwnedEnds()
* @generated
*/
Property getNavigableOwnedEnd(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Navigable Owned End</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Property} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getNavigableOwnedEnds()
* @generated
*/
Property getNavigableOwnedEnd(String name, Type type, boolean ignoreCase,
EClass eClass, boolean createOnDemand);
/**
* Returns the value of the '<em><b>Owned End</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Property}.
* It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.Property#getOwningAssociation <em>Owning Association</em>}'.
* <p>
* This feature subsets the following features:
* </p>
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Association#getMemberEnds() <em>Member End</em>}'</li>
* <li>'{@link org.eclipse.uml2.uml.Classifier#getFeatures() <em>Feature</em>}'</li>
* <li>'{@link org.eclipse.uml2.uml.Namespace#getOwnedMembers() <em>Owned Member</em>}'</li>
* </ul>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The ends that are owned by the Association itself.
* <p>From package UML::StructuredClassifiers.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Owned End</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getAssociation_OwnedEnd()
* @see org.eclipse.uml2.uml.Property#getOwningAssociation
* @model opposite="owningAssociation" containment="true" resolveProxies="true"
* @generated
*/
EList<Property> getOwnedEnds();
/**
* Creates a new {@link org.eclipse.uml2.uml.Property}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and appends it to the '<em><b>Owned End</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Property} to create.
* @return The new {@link org.eclipse.uml2.uml.Property}.
* @see #getOwnedEnds()
* @generated
*/
Property createOwnedEnd(String name, Type type, EClass eClass);
/**
* Creates a new {@link org.eclipse.uml2.uml.Property}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and appends it to the '<em><b>Owned End</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.Property}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Property}.
* @see #getOwnedEnds()
* @generated
*/
Property createOwnedEnd(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Owned End</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getOwnedEnds()
* @generated
*/
Property getOwnedEnd(String name, Type type);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>' from the '<em><b>Owned End</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Property} to retrieve, or <code>null</code>.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Property} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Property} with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', or <code>null</code>.
* @see #getOwnedEnds()
* @generated
*/
Property getOwnedEnd(String name, Type type, boolean ignoreCase,
EClass eClass, boolean createOnDemand);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* An Association specializing another Association has the same number of ends as the other Association.
* parents()->select(oclIsKindOf(Association)).oclAsType(Association)->forAll(p | p.memberEnd->size() = self.memberEnd->size())
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateSpecializedEndNumber(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* When an Association specializes another Association, every end of the specific Association corresponds to an end of the general Association, and the specific end reaches the same type or a subtype of the corresponding general end.
* Sequence{1..memberEnd->size()}->
* forAll(i | general->select(oclIsKindOf(Association)).oclAsType(Association)->
* forAll(ga | self.memberEnd->at(i).type.conformsTo(ga.memberEnd->at(i).type)))
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateSpecializedEndTypes(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Only binary Associations can be aggregations.
* memberEnd->exists(aggregation <> AggregationKind::none) implies (memberEnd->size() = 2 and memberEnd->exists(aggregation = AggregationKind::none))
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateBinaryAssociations(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Ends of Associations with more than two ends must be owned by the Association itself.
* memberEnd->size() > 2 implies ownedEnd->includesAll(memberEnd)
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateAssociationEnds(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* memberEnd->forAll(type->notEmpty())
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateEndsMustBeTyped(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Determines whether this association is a binary association, i.e. whether it has exactly two member ends.
* <!-- end-model-doc -->
* @model kind="operation" dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false"
* @generated
*/
boolean isBinary();
} // Association