| /* |
| * Copyright (c) 2005 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM - initial API and implementation |
| * |
| * $Id: MultiplicityElement.java,v 1.5 2005/12/12 16:58:34 khussey Exp $ |
| */ |
| package org.eclipse.uml2.uml; |
| |
| import java.util.Map; |
| |
| import org.eclipse.emf.common.util.DiagnosticChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * A representation of the model object '<em><b>Multiplicity Element</b></em>'. |
| * <!-- end-user-doc --> |
| * |
| * <!-- begin-model-doc --> |
| * A MultiplicityElement is an abstract metaclass which includes optional attributes for defining the bounds of a multiplicity. A MultiplicityElement also includes specifications of whether the values in an instantiation of this element must be unique or ordered. |
| * <!-- end-model-doc --> |
| * |
| * <p> |
| * The following features are supported: |
| * <ul> |
| * <li>{@link org.eclipse.uml2.uml.MultiplicityElement#isOrdered <em>Is Ordered</em>}</li> |
| * <li>{@link org.eclipse.uml2.uml.MultiplicityElement#isUnique <em>Is Unique</em>}</li> |
| * <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getUpper <em>Upper</em>}</li> |
| * <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getLower <em>Lower</em>}</li> |
| * <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getUpperValue <em>Upper Value</em>}</li> |
| * <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getLowerValue <em>Lower Value</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement() |
| * @model abstract="true" |
| * @generated |
| */ |
| public interface MultiplicityElement |
| extends Element { |
| |
| /** |
| * Returns the value of the '<em><b>Is Ordered</b></em>' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * For a multivalued multiplicity, this attribute specifies whether the values in an instantiation of this element are sequentially ordered.. |
| * For a multivalued multiplicity, this attribute specifies whether the values in an instantiation of this element are sequentially ordered. |
| * <!-- end-model-doc --> |
| * @return the value of the '<em>Is Ordered</em>' attribute. |
| * @see #setIsOrdered(boolean) |
| * @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_IsOrdered() |
| * @model dataType="org.eclipse.uml2.uml.Boolean" required="true" ordered="false" |
| * @generated |
| */ |
| boolean isOrdered(); |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#isOrdered <em>Is Ordered</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Is Ordered</em>' attribute. |
| * @see #isOrdered() |
| * @generated |
| */ |
| void setIsOrdered(boolean value); |
| |
| /** |
| * Returns the value of the '<em><b>Is Unique</b></em>' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * For a multivalued multiplicity, this attributes specifies whether the values in an instantiation of this element are unique. |
| * <!-- end-model-doc --> |
| * @return the value of the '<em>Is Unique</em>' attribute. |
| * @see #setIsUnique(boolean) |
| * @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_IsUnique() |
| * @model dataType="org.eclipse.uml2.uml.Boolean" required="true" ordered="false" |
| * @generated |
| */ |
| boolean isUnique(); |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#isUnique <em>Is Unique</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Is Unique</em>' attribute. |
| * @see #isUnique() |
| * @generated |
| */ |
| void setIsUnique(boolean value); |
| |
| /** |
| * Returns the value of the '<em><b>Upper</b></em>' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * Specifies the upper bound of the multiplicity interval. |
| * Specifies the upper bound of the multiplicity interval, if it is expressed as an unlimited natural. |
| * <!-- end-model-doc --> |
| * @return the value of the '<em>Upper</em>' attribute. |
| * @see #isSetUpper() |
| * @see #unsetUpper() |
| * @see #setUpper(int) |
| * @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_Upper() |
| * @model unsettable="true" dataType="org.eclipse.uml2.uml.UnlimitedNatural" volatile="true" derived="true" ordered="false" |
| * @generated |
| */ |
| int getUpper(); |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getUpper <em>Upper</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Upper</em>' attribute. |
| * @see #isSetUpper() |
| * @see #unsetUpper() |
| * @see #getUpper() |
| * @generated |
| */ |
| void setUpper(int value); |
| |
| /** |
| * Unsets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getUpper <em>Upper</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isSetUpper() |
| * @see #getUpper() |
| * @see #setUpper(int) |
| * @generated |
| */ |
| void unsetUpper(); |
| |
| /** |
| * Returns whether the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getUpper <em>Upper</em>}' attribute is set. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @return whether the value of the '<em>Upper</em>' attribute is set. |
| * @see #unsetUpper() |
| * @see #getUpper() |
| * @see #setUpper(int) |
| * @generated |
| */ |
| boolean isSetUpper(); |
| |
| /** |
| * Returns the value of the '<em><b>Lower</b></em>' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * Specifies the lower bound of the multiplicity interval. |
| * Specifies the lower bound of the multiplicity interval, if it is expressed as an integer. |
| * <!-- end-model-doc --> |
| * @return the value of the '<em>Lower</em>' attribute. |
| * @see #isSetLower() |
| * @see #unsetLower() |
| * @see #setLower(int) |
| * @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_Lower() |
| * @model unsettable="true" dataType="org.eclipse.uml2.uml.Integer" volatile="true" derived="true" ordered="false" |
| * @generated |
| */ |
| int getLower(); |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getLower <em>Lower</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Lower</em>' attribute. |
| * @see #isSetLower() |
| * @see #unsetLower() |
| * @see #getLower() |
| * @generated |
| */ |
| void setLower(int value); |
| |
| /** |
| * Unsets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getLower <em>Lower</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isSetLower() |
| * @see #getLower() |
| * @see #setLower(int) |
| * @generated |
| */ |
| void unsetLower(); |
| |
| /** |
| * Returns whether the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getLower <em>Lower</em>}' attribute is set. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @return whether the value of the '<em>Lower</em>' attribute is set. |
| * @see #unsetLower() |
| * @see #getLower() |
| * @see #setLower(int) |
| * @generated |
| */ |
| boolean isSetLower(); |
| |
| /** |
| * Returns the value of the '<em><b>Upper Value</b></em>' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The specification of the upper bound for this multiplicity. |
| * <!-- end-model-doc --> |
| * @return the value of the '<em>Upper Value</em>' containment reference. |
| * @see #setUpperValue(ValueSpecification) |
| * @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_UpperValue() |
| * @model containment="true" resolveProxies="false" ordered="false" |
| * @generated |
| */ |
| ValueSpecification getUpperValue(); |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getUpperValue <em>Upper Value</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Upper Value</em>' containment reference. |
| * @see #getUpperValue() |
| * @generated |
| */ |
| void setUpperValue(ValueSpecification value); |
| |
| /** |
| * Creates a {@link org.eclipse.uml2.uml.ValueSpecification} and sets the '<em><b>Upper Value</b></em>' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.ValueSpecification} to create. |
| * @return The new {@link org.eclipse.uml2.uml.ValueSpecification}. |
| * @see #getUpperValue() |
| * @generated |
| */ |
| ValueSpecification createUpperValue(EClass eClass); |
| |
| /** |
| * Returns the value of the '<em><b>Lower Value</b></em>' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The specification of the lower bound for this multiplicity. |
| * <!-- end-model-doc --> |
| * @return the value of the '<em>Lower Value</em>' containment reference. |
| * @see #setLowerValue(ValueSpecification) |
| * @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_LowerValue() |
| * @model containment="true" resolveProxies="false" ordered="false" |
| * @generated |
| */ |
| ValueSpecification getLowerValue(); |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.uml2.uml.MultiplicityElement#getLowerValue <em>Lower Value</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Lower Value</em>' containment reference. |
| * @see #getLowerValue() |
| * @generated |
| */ |
| void setLowerValue(ValueSpecification value); |
| |
| /** |
| * Creates a {@link org.eclipse.uml2.uml.ValueSpecification} and sets the '<em><b>Lower Value</b></em>' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.ValueSpecification} to create. |
| * @return The new {@link org.eclipse.uml2.uml.ValueSpecification}. |
| * @see #getLowerValue() |
| * @generated |
| */ |
| ValueSpecification createLowerValue(EClass eClass); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * A multiplicity must define at least one valid cardinality that is greater than zero. |
| * upperBound()->notEmpty() implies upperBound() > 0 |
| * <!-- end-model-doc --> |
| * @model |
| * @generated |
| */ |
| boolean validateUpperGt0(DiagnosticChain diagnostics, Map context); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The lower bound must be a non-negative integer literal. |
| * lowerBound()->notEmpty() implies lowerBound() >= 0 |
| * <!-- end-model-doc --> |
| * @model |
| * @generated |
| */ |
| boolean validateLowerGe0(DiagnosticChain diagnostics, Map context); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The upper bound must be greater than or equal to the lower bound. |
| * (upperBound()->notEmpty() and lowerBound()->notEmpty()) implies upperBound() >= lowerBound() |
| * <!-- end-model-doc --> |
| * @model |
| * @generated |
| */ |
| boolean validateUpperGeLower(DiagnosticChain diagnostics, Map context); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * If a non-literal ValueSpecification is used for the lower or upper bound, then evaluating that specification must not have side effects. |
| * true |
| * <!-- end-model-doc --> |
| * @model |
| * @generated |
| */ |
| boolean validateValueSpecificationNoSideEffects( |
| DiagnosticChain diagnostics, Map context); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * If a non-literal ValueSpecification is used for the lower or upper bound, then that specification must be a constant expression. |
| * true |
| * <!-- end-model-doc --> |
| * @model |
| * @generated |
| */ |
| boolean validateValueSpecificationConstant(DiagnosticChain diagnostics, |
| Map context); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The query isMultivalued() checks whether this multiplicity has an upper bound greater than one. |
| * upperBound()->notEmpty() |
| * result = upperBound() > 1 |
| * <!-- end-model-doc --> |
| * @model kind="operation" dataType="org.eclipse.uml2.uml.Boolean" required="true" ordered="false" |
| * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='spec'" |
| * @generated |
| */ |
| boolean isMultivalued(); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The query includesCardinality() checks whether the specified cardinality is valid for this multiplicity. |
| * upperBound()->notEmpty() and lowerBound()->notEmpty() |
| * result = (lowerBound() <= C) and (upperBound() >= C) |
| * <!-- end-model-doc --> |
| * @model dataType="org.eclipse.uml2.uml.Boolean" required="true" ordered="false" CDataType="org.eclipse.uml2.uml.Integer" CRequired="true" COrdered="false" |
| * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='spec'" |
| * @generated |
| */ |
| boolean includesCardinality(int C); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The query includesMultiplicity() checks whether this multiplicity includes all the cardinalities allowed by the specified multiplicity. |
| * self.upperBound()->notEmpty() and self.lowerBound()->notEmpty() |
| * and M.upperBound()->notEmpty() and M.lowerBound()->notEmpty() |
| * |
| * result = (self.lowerBound() <= M.lowerBound()) and (self.upperBound() >= M.upperBound()) |
| * <!-- end-model-doc --> |
| * @model dataType="org.eclipse.uml2.uml.Boolean" required="true" ordered="false" MRequired="true" MOrdered="false" |
| * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='spec'" |
| * @generated |
| */ |
| boolean includesMultiplicity(MultiplicityElement M); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The query lowerBound() returns the lower bound of the multiplicity as an integer. |
| * result = if lowerValue->isEmpty() then 1 else lowerValue.integerValue() endif |
| * <!-- end-model-doc --> |
| * @model dataType="org.eclipse.uml2.uml.Integer" required="true" ordered="false" |
| * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='spec'" |
| * @generated |
| */ |
| int lowerBound(); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * <!-- begin-model-doc --> |
| * The query upperBound() returns the upper bound of the multiplicity for a bounded multiplicity as an unlimited natural. |
| * result = if upperValue->isEmpty() then 1 else upperValue.unlimitedValue() endif |
| * <!-- end-model-doc --> |
| * @model dataType="org.eclipse.uml2.uml.UnlimitedNatural" required="true" ordered="false" |
| * annotation="http://www.eclipse.org/emf/2002/Ecore constraints='spec'" |
| * @generated |
| */ |
| int upperBound(); |
| |
| } // MultiplicityElement |