Software Disclaimer

Abstract Class UML 2.5::MultiplicityElement


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.

Direct Superclasses: Element

Direct Subclasses: Variable, StructuralFeature, Pin, Parameter, ConnectorEnd

Class Precedence List: MultiplicityElement, Element


isOrdered : Boolean (1 1); -- source MultiplicityElement
isUnique : Boolean (1 1); -- source MultiplicityElement
lower : Integer (1 1); -- source MultiplicityElement

The lower bound of the multiplicity interval.

lowerValue : ValueSpecification (0 1); -- source MultiplicityElement
upper : UnlimitedNatural (1 1); -- source MultiplicityElement
upperValue : ValueSpecification (0 1); -- source MultiplicityElement

The specification of the upper bound for this multiplicity.
Subsets: Element.ownedElement

ownedComment : Comment (0 *); -- source Element
ownedElement : Element (0 *); -- source Element

The Elements owned by this Element.
{composite, readonly}
Derived union with sources: (ownedComment, upperValue, lowerValue)
Opposite: Element.owner

owner : Element (0 1); -- source Element


Signature: CMOF_14_3_13() : Boolean;
Description: 14.3 [13] The values of MultiplicityElement::lowerValue and upperValue must be of kind LiteralInteger and LiteralUnlimitedNatural respectively see also: see also:
Expression: lowerValue.oclIsKindOf(LiteralInteger) and upperValue.oclIsKindOf(LiteralUnlimitedNatural)


Signature: upperBound() : UnlimitedNatural;
Description: 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.
Expression: result = (if (upperValue=null or upperValue.unlimitedValue()=null) then 1 else upperValue.unlimitedValue() endif)

Signature: upper.1() : UnlimitedNatural;
Description: The derived upper attribute must equal the upperBound.
Expression: result = (upperBound())

Signature: lowerBound() : Integer;
Description: 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.
Expression: result = (if (lowerValue=null or lowerValue.integerValue()=null) then 1 else lowerValue.integerValue() endif)

Signature: lower.1() : Integer;
Description: The derived lower attribute must equal the lowerBound.
Expression: result = (lowerBound())

Signature: isMultivalued() : Boolean;
Description: The query isMultivalued() checks whether this multiplicity has an upper bound greater than one.
Expression: result = (upperBound() > 1)

Signature: is(lowerbound : Integer; upperbound : UnlimitedNatural; ) : Boolean;
Description: The operation is determines if the upper and lower bound of the ranges are the ones given.
Expression: result = (lowerbound = self.lowerBound() and upperbound = self.upperBound())

Signature: includesMultiplicity(M : MultiplicityElement; ) : Boolean;
Description: The query includesMultiplicity() checks whether this multiplicity includes all the cardinalities allowed by the specified multiplicity.
Expression: result = ((self.lowerBound() <= M.lowerBound()) and (self.upperBound() >= M.upperBound()))

Signature: compatibleWith(other : MultiplicityElement; ) : Boolean;
Description: The operation compatibleWith takes another multiplicity as input. It returns true if the other multiplicity is wider than, or the same as, self.
Expression: result = ((other.lowerBound() <= self.lowerBound()) and ((other.upperBound() = *) or (self.upperBound() <= other.upperBound())))

Send questions or comments to