org.eclipse.uml2.uml
Interface MultiplicityElement

All Superinterfaces:
Element, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier
All Known Subinterfaces:
ActionInputPin, ConnectorEnd, ExtensionEnd, InputPin, OutputPin, Parameter, Pin, Port, Property, StructuralFeature, ValuePin, Variable

public interface MultiplicityElement
extends Element

A representation of the model object 'Multiplicity Element'. 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.

From package UML::CommonStructure.

The following features are supported:

See Also:
UMLPackage.getMultiplicityElement()

Method Summary
 boolean compatibleWith(MultiplicityElement other)
          The operation compatibleWith takes another multiplicity as input.
 ValueSpecification createLowerValue(java.lang.String name, Type type, org.eclipse.emf.ecore.EClass eClass)
          Creates a new ValueSpecification, with the specified 'Name', and 'Type', and sets the 'Lower Value' containment reference
 ValueSpecification createUpperValue(java.lang.String name, Type type, org.eclipse.emf.ecore.EClass eClass)
          Creates a new ValueSpecification, with the specified 'Name', and 'Type', and sets the 'Upper Value' containment reference
 int getLower()
          Returns the value of the 'Lower' attribute.
 ValueSpecification getLowerValue()
          Returns the value of the 'Lower Value' containment reference.
 int getUpper()
          Returns the value of the 'Upper' attribute.
 ValueSpecification getUpperValue()
          Returns the value of the 'Upper Value' containment reference.
 boolean includesMultiplicity(MultiplicityElement M)
          The query includesMultiplicity() checks whether this multiplicity includes all the cardinalities allowed by the specified multiplicity.
 boolean is(int lowerbound, int upperbound)
          The operation is determines if the upper and lower bound of the ranges are the ones given.
 boolean isMultivalued()
          The query isMultivalued() checks whether this multiplicity has an upper bound greater than one.
 boolean isOrdered()
          Returns the value of the 'Is Ordered' attribute.
 boolean isUnique()
          Returns the value of the 'Is Unique' attribute.
 int lowerBound()
          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.
 void setIsOrdered(boolean value)
          Sets the value of the 'Is Ordered' attribute
 void setIsUnique(boolean value)
          Sets the value of the 'Is Unique' attribute
 void setLower(int value)
          Sets the value of the 'Lower' attribute
 void setLowerValue(ValueSpecification value)
          Sets the value of the 'Lower Value' containment reference
 void setUpper(int value)
          Sets the value of the 'Upper' attribute
 void setUpperValue(ValueSpecification value)
          Sets the value of the 'Upper Value' containment reference
 int upperBound()
          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.
 boolean validateLowerGe0(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The lower bound must be a non-negative integer literal.
 boolean validateLowerIsInteger(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          If it is not empty, then lowerValue must have an Integer value.
 boolean validateUpperGeLower(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          The upper bound must be greater than or equal to the lower bound.
 boolean validateUpperIsUnlimitedNatural(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          If it is not empty, then upperValue must have an UnlimitedNatural value.
 boolean validateValueSpecificationConstant(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          If a non-literal ValueSpecification is used for lowerValue or upperValue, then that specification must be a constant expression.
 boolean validateValueSpecificationNoSideEffects(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          If a non-literal ValueSpecification is used for lowerValue or upperValue, then evaluating that specification must not have side effects.
 
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

isOrdered

boolean isOrdered()
Returns the value of the 'Is Ordered' attribute. The default value is "false". For a multivalued multiplicity, this attribute specifies whether the values in an instantiation of this MultiplicityElement are sequentially ordered.

From package UML::CommonStructure.

Returns:
the value of the 'Is Ordered' attribute.
See Also:
setIsOrdered(boolean), UMLPackage.getMultiplicityElement_IsOrdered()

setIsOrdered

void setIsOrdered(boolean value)
Sets the value of the 'Is Ordered' attribute.

Parameters:
value - the new value of the 'Is Ordered' attribute.
See Also:
isOrdered()

isUnique

boolean isUnique()
Returns the value of the 'Is Unique' attribute. The default value is "true". For a multivalued multiplicity, this attributes specifies whether the values in an instantiation of this MultiplicityElement are unique.

From package UML::CommonStructure.

Returns:
the value of the 'Is Unique' attribute.
See Also:
setIsUnique(boolean), UMLPackage.getMultiplicityElement_IsUnique()

setIsUnique

void setIsUnique(boolean value)
Sets the value of the 'Is Unique' attribute.

Parameters:
value - the new value of the 'Is Unique' attribute.
See Also:
isUnique()

getUpper

int getUpper()
Returns the value of the 'Upper' attribute. The default value is "1". The upper bound of the multiplicity interval.

From package UML::CommonStructure.

Returns:
the value of the 'Upper' attribute.
See Also:
setUpper(int), UMLPackage.getMultiplicityElement_Upper()

setUpper

void setUpper(int value)
Sets the value of the 'Upper' attribute.

Parameters:
value - the new value of the 'Upper' attribute.
See Also:
getUpper()

getLower

int getLower()
Returns the value of the 'Lower' attribute. The default value is "1". The lower bound of the multiplicity interval.

From package UML::CommonStructure.

Returns:
the value of the 'Lower' attribute.
See Also:
setLower(int), UMLPackage.getMultiplicityElement_Lower()

setLower

void setLower(int value)
Sets the value of the 'Lower' attribute.

Parameters:
value - the new value of the 'Lower' attribute.
See Also:
getLower()

getUpperValue

ValueSpecification getUpperValue()
Returns the value of the 'Upper Value' containment reference.

This feature subsets the following features:

The specification of the upper bound for this multiplicity.

From package UML::CommonStructure.

Returns:
the value of the 'Upper Value' containment reference.
See Also:
setUpperValue(ValueSpecification), UMLPackage.getMultiplicityElement_UpperValue()

setUpperValue

void setUpperValue(ValueSpecification value)
Sets the value of the 'Upper Value' containment reference.

Parameters:
value - the new value of the 'Upper Value' containment reference.
See Also:
getUpperValue()

createUpperValue

ValueSpecification createUpperValue(java.lang.String name,
                                    Type type,
                                    org.eclipse.emf.ecore.EClass eClass)
Creates a new ValueSpecification, with the specified 'Name', and 'Type', and sets the 'Upper Value' containment reference.

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

getLowerValue

ValueSpecification getLowerValue()
Returns the value of the 'Lower Value' containment reference.

This feature subsets the following features:

The specification of the lower bound for this multiplicity.

From package UML::CommonStructure.

Returns:
the value of the 'Lower Value' containment reference.
See Also:
setLowerValue(ValueSpecification), UMLPackage.getMultiplicityElement_LowerValue()

setLowerValue

void setLowerValue(ValueSpecification value)
Sets the value of the 'Lower Value' containment reference.

Parameters:
value - the new value of the 'Lower Value' containment reference.
See Also:
getLowerValue()

createLowerValue

ValueSpecification createLowerValue(java.lang.String name,
                                    Type type,
                                    org.eclipse.emf.ecore.EClass eClass)
Creates a new ValueSpecification, with the specified 'Name', and 'Type', and sets the 'Lower Value' containment reference.

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

validateLowerGe0

boolean validateLowerGe0(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                         java.util.Map<java.lang.Object,java.lang.Object> context)
The lower bound must be a non-negative integer literal. lowerBound() >= 0

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

validateUpperGeLower

boolean validateUpperGeLower(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                             java.util.Map<java.lang.Object,java.lang.Object> context)
The upper bound must be greater than or equal to the lower bound. upperBound() >= lowerBound()

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

validateValueSpecificationNoSideEffects

boolean validateValueSpecificationNoSideEffects(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                                java.util.Map<java.lang.Object,java.lang.Object> context)
If a non-literal ValueSpecification is used for lowerValue or upperValue, then evaluating that specification must not have side effects.

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

validateValueSpecificationConstant

boolean validateValueSpecificationConstant(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                           java.util.Map<java.lang.Object,java.lang.Object> context)
If a non-literal ValueSpecification is used for lowerValue or upperValue, then that specification must be a constant expression.

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

validateLowerIsInteger

boolean validateLowerIsInteger(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                               java.util.Map<java.lang.Object,java.lang.Object> context)
If it is not empty, then lowerValue must have an Integer value. lowerValue <> null implies lowerValue.integerValue() <> null

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

validateUpperIsUnlimitedNatural

boolean validateUpperIsUnlimitedNatural(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                        java.util.Map<java.lang.Object,java.lang.Object> context)
If it is not empty, then upperValue must have an UnlimitedNatural value. upperValue <> null implies upperValue.unlimitedValue() <> null

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

isMultivalued

boolean isMultivalued()
The query isMultivalued() checks whether this multiplicity has an upper bound greater than one. upperBound()->notEmpty() result = (upperBound() > 1)

From package UML::CommonStructure.


includesMultiplicity

boolean includesMultiplicity(MultiplicityElement M)
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()))

From package UML::CommonStructure.


lowerBound

int lowerBound()
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)

From package UML::CommonStructure.


upperBound

int upperBound()
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)

From package UML::CommonStructure.


compatibleWith

boolean compatibleWith(MultiplicityElement other)
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())))

From package UML::CommonStructure.


is

boolean is(int lowerbound,
           int upperbound)
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())

From package UML::CommonStructure.


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