MultiplicityElement is specialized to support the use of value specifications to define each bound of the multiplicity.
Attributes
/lower : Integer [0..1] | Specifies the lower bound of the multiplicity interval, if it is expressed as an integer. This is a redefinition of the corresponding property from Multiplicities.
|
/upper : UnlimitedNatural [0..1] | Specifies the upper bound of the multiplicity interval, if it is expressed as an unlimited natural. This is a redefinition of the corresponding property from Multiplicities.
|
lowerValue: ValueSpecification [0..1] | The specification of the lower bound for this multiplicity. Subsets Ele- ment::ownedElement.
|
upperValue: ValueSpecification [0..1] | The specification of the upper bound for this multiplicity. Subsets Ele- ment::ownedElement.
|
Cannot be expressed in OCL.
Cannot be expressed in OCL.
lower = lowerBound()
upper = upperBound()
Additional Operations
MultiplicityElement::lowerBound() : [Integer];
lowerBound =
if lowerValue->isEmpty() then
1
else lowerValue.integerValue()
endif
MultiplicityElement::upperBound() : [UnlimitedNatural];
upperBound =
if upperValue->isEmpty() then
1
elseupperValue.unlimitedValue()
endif
The lower and upper bounds for the multiplicity of a MultiplicityElement may be specified by value specifications, such as (side-effect free, constant) expressions.
Notation
The notation for Multiplicities::MultiplicityElement (see page 71) is extended to support value specifications for the bounds.
The following BNF defines the syntax for a multiplicity string, including support for the presentation options.
multiplicity ::= <multiplicity_range> [ `{` <order_designator> `}' ]
multiplicity_range ::= [ lower `..' ] upper
lower ::= integer | value_specification
upper ::= unlimited_natural | `*' | value_specification
<order_designator> ::= ordered | unordered
<uniqueness_designator> ::= unique | nonunique