blob: 03bc6f8483d36626c411f7f3c5272f4fbc058fd5 [file] [log] [blame]
/*
* Copyright (c) 2005, 2018 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, 485756
* 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.ecore.EClass;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Multiplicity Element</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* A multiplicity is a definition of an inclusive interval of non-negative integers beginning with a lower bound and ending with a (possibly infinite) upper bound. A MultiplicityElement embeds this information to specify the allowable cardinalities for an instantiation of the Element.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* </p>
* <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#getLower <em>Lower</em>}</li>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getLowerValue <em>Lower Value</em>}</li>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getUpper <em>Upper</em>}</li>
* <li>{@link org.eclipse.uml2.uml.MultiplicityElement#getUpperValue <em>Upper Value</em>}</li>
* </ul>
*
* @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.
* The default value is <code>"false"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* For a multivalued multiplicity, this attribute specifies whether the values in an instantiation of this MultiplicityElement are sequentially ordered.
* <p>From package UML::CommonStructure.</p>
* <!-- 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 default="false" dataType="org.eclipse.uml2.types.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.
* The default value is <code>"true"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* For a multivalued multiplicity, this attributes specifies whether the values in an instantiation of this MultiplicityElement are unique.
* <p>From package UML::CommonStructure.</p>
* <!-- 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 default="true" dataType="org.eclipse.uml2.types.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.
* The default value is <code>"1"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The upper bound of the multiplicity interval.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Upper</em>' attribute.
* @see #setUpper(int)
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_Upper()
* @model default="1" dataType="org.eclipse.uml2.types.UnlimitedNatural" required="true" transient="true" 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 #getUpper()
* @generated
*/
void setUpper(int value);
/**
* Returns the value of the '<em><b>Lower</b></em>' attribute.
* The default value is <code>"1"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The lower bound of the multiplicity interval.
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @return the value of the '<em>Lower</em>' attribute.
* @see #setLower(int)
* @see org.eclipse.uml2.uml.UMLPackage#getMultiplicityElement_Lower()
* @model default="1" dataType="org.eclipse.uml2.types.Integer" transient="true" 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 #getLower()
* @generated
*/
void setLower(int value);
/**
* Returns the value of the '<em><b>Upper Value</b></em>' containment reference.
* <p>
* This feature subsets the following features:
* </p>
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Element#getOwnedElements() <em>Owned Element</em>}'</li>
* </ul>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The specification of the upper bound for this multiplicity.
* <p>From package UML::CommonStructure.</p>
* <!-- 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="true" 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 new {@link org.eclipse.uml2.uml.ValueSpecification}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and sets the '<em><b>Upper Value</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.ValueSpecification}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.ValueSpecification}, or <code>null</code>.
* @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(String name, Type type, EClass eClass);
/**
* Returns the value of the '<em><b>Lower Value</b></em>' containment reference.
* <p>
* This feature subsets the following features:
* </p>
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Element#getOwnedElements() <em>Owned Element</em>}'</li>
* </ul>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The specification of the lower bound for this multiplicity.
* <p>From package UML::CommonStructure.</p>
* <!-- 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="true" 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 new {@link org.eclipse.uml2.uml.ValueSpecification}, with the specified '<em><b>Name</b></em>', and '<em><b>Type</b></em>', and sets the '<em><b>Lower Value</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.ValueSpecification}, or <code>null</code>.
* @param type The '<em><b>Type</b></em>' for the new {@link org.eclipse.uml2.uml.ValueSpecification}, or <code>null</code>.
* @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(String name, Type type, EClass eClass);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The lower bound must be a non-negative integer literal.
* lowerBound() >= 0
* @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 validateLowerGe0(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The upper bound must be greater than or equal to the lower bound.
* upperBound() >= lowerBound()
* @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 validateUpperGeLower(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If a non-literal ValueSpecification is used for lowerValue or upperValue, then evaluating that specification must not have side effects.
* @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 validateValueSpecificationNoSideEffects(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If a non-literal ValueSpecification is used for lowerValue or upperValue, then that specification must be a constant expression.
* @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 validateValueSpecificationConstant(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If it is not empty, then lowerValue must have an Integer value.
* lowerValue <> null implies lowerValue.integerValue() <> null
* @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 validateLowerIsInteger(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If it is not empty, then upperValue must have an UnlimitedNatural value.
* upperValue <> null implies upperValue.unlimitedValue() <> null
* @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 validateUpperIsUnlimitedNatural(DiagnosticChain diagnostics,
Map<Object, Object> 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)
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model kind="operation" dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false"
* @generated
*/
boolean isMultivalued();
/**
* <!-- 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()))
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" MRequired="true" MOrdered="false"
* @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, which is the integerValue of lowerValue, if this is given, and 1 otherwise.
* result = (if (lowerValue=null or lowerValue.integerValue()=null) then 1 else lowerValue.integerValue() endif)
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.Integer" ordered="false"
* @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, which is the unlimitedNaturalValue of upperValue, if given, and 1, otherwise.
* result = (if (upperValue=null or upperValue.unlimitedValue()=null) then 1 else upperValue.unlimitedValue() endif)
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.UnlimitedNatural" required="true" ordered="false"
* @generated
*/
int upperBound();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The operation compatibleWith takes another multiplicity as input. It returns true if the other multiplicity is wider than, or the same as, self.
* result = ((other.lowerBound() <= self.lowerBound()) and ((other.upperBound() = *) or (self.upperBound() <= other.upperBound())))
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" otherRequired="true" otherOrdered="false"
* @generated
*/
boolean compatibleWith(MultiplicityElement other);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The operation is determines if the upper and lower bound of the ranges are the ones given.
* result = (lowerbound = self.lowerBound() and upperbound = self.upperBound())
* <p>From package UML::CommonStructure.</p>
* <!-- end-model-doc -->
* @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" lowerboundDataType="org.eclipse.uml2.types.Integer" lowerboundRequired="true" lowerboundOrdered="false" upperboundDataType="org.eclipse.uml2.types.UnlimitedNatural" upperboundRequired="true" upperboundOrdered="false"
* @generated
*/
boolean is(int lowerbound, int upperbound);
} // MultiplicityElement