Class 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 multiplicity element embeds this information to specify the allowable cardinalities for an instantiation of this element.
[XmlNamespace("http://www.omg.org/spec/MOF/20131001/cmof.xmi")]
[XmlNamespacePrefix("cmof")]
[ModelRepresentationClass("http://www.omg.org/spec/MOF/20131001/cmof.xmi#//MultiplicityElement")]
public abstract class MultiplicityElement : Element, IMultiplicityElement, IElement, IObject, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
- Inheritance
-
MultiplicityElement
- Implements
- Derived
- Inherited Members
Properties
Children
Gets the child model elements of this model element
public override IEnumerableExpression<IModelElement> Children { get; }
Property Value
ClassInstance
Gets the Class model for this type
public static IClass ClassInstance { get; }
Property Value
IsOrdered
For a multivalued multiplicity, this attribute specifies whether the values in an instantiation of this element are sequentially ordered.
[TypeConverter(typeof(LowercaseBooleanConverter))]
[XmlElementName("isOrdered")]
[XmlAttribute(true)]
public bool IsOrdered { get; set; }
Property Value
IsUnique
For a multivalued multiplicity, this attributes specifies whether the values in an instantiation of this element are unique.
[TypeConverter(typeof(LowercaseBooleanConverter))]
[XmlElementName("isUnique")]
[XmlAttribute(true)]
public bool IsUnique { get; set; }
Property Value
LowerValue
The specification of the lower bound for this multiplicity.
[Browsable(false)]
[XmlElementName("lowerValue")]
[XmlAttribute(false)]
[Containment]
public IValueSpecification LowerValue { get; set; }
Property Value
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
UpperValue
The specification of the upper bound for this multiplicity.
[Browsable(false)]
[XmlElementName("upperValue")]
[XmlAttribute(false)]
[Containment]
public IValueSpecification UpperValue { get; set; }
Property Value
Methods
GetAttributeValue(string, int)
Resolves the given attribute name
protected override object GetAttributeValue(string attribute, int index)
Parameters
Returns
- object
The attribute value or null if it could not be found
GetClass()
Gets the Class for this model element
public override IClass GetClass()
Returns
GetExpressionForAttribute(string)
Gets the property expression for the given attribute
protected override INotifyExpression<object> GetExpressionForAttribute(string attribute)
Parameters
attribute
stringThe requested attribute in upper case
Returns
- INotifyExpression<object>
An incremental property expression
GetExpressionForReference(string)
Gets the property expression for the given reference
protected override INotifyExpression<IModelElement> GetExpressionForReference(string reference)
Parameters
reference
stringThe requested reference in upper case
Returns
- INotifyExpression<IModelElement>
An incremental property expression
GetModelElementForReference(string, int)
Resolves the given URI to a child model element
protected override IModelElement GetModelElementForReference(string reference, int index)
Parameters
Returns
- IModelElement
The model element or null if it could not be found
GetRelativePathForNonIdentifiedChild(IModelElement)
Gets the relative URI fragment for the given child model element
protected override string GetRelativePathForNonIdentifiedChild(IModelElement element)
Parameters
element
IModelElementThe element that should be looked for
Returns
- string
A fragment of the relative URI
IncludesCardinality(int)
The query includesCardinality() checks whether the specified cardinality is valid for this multiplicity. result = (lowerBound() <= C) and (upperBound() >= C) upperBound()->notEmpty() and lowerBound()->notEmpty()
public bool IncludesCardinality(int c)
Parameters
c
int
Returns
IncludesMultiplicity(IMultiplicityElement)
The query includesMultiplicity() checks whether this multiplicity includes all the cardinalities allowed by the specified multiplicity. result = (self.lowerBound() <= M.lowerBound()) and (self.upperBound() >= M.upperBound()) self.upperBound()->notEmpty() and self.lowerBound()->notEmpty() and M.upperBound()->notEmpty() and M.lowerBound()->notEmpty()
public bool IncludesMultiplicity(IMultiplicityElement m)
Parameters
Returns
IsMultivalued()
The query isMultivalued() checks whether this multiplicity has an upper bound greater than one. upperBound()->notEmpty() result = upperBound() > 1
public bool IsMultivalued()
Returns
LowerBound()
The query lowerBound() returns the lower bound of the multiplicity as an integer. result = if lowerValue->isEmpty() then 1 else lowerValue.integerValue() endif
public int LowerBound()
Returns
Lower_ge_0(object, object)
The lower bound must be a non-negative integer literal. lowerBound()->notEmpty() implies lowerBound() >= 0
public bool Lower_ge_0(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
SetFeature(string, object)
Sets a value to the given feature
protected override void SetFeature(string feature, object value)
Parameters
UpperBound()
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
public void UpperBound()
Upper_ge_lower(object, object)
The upper bound must be greater than or equal to the lower bound. (upperBound()->notEmpty() and lowerBound()->notEmpty()) implies upperBound() >= lowerBound()
public bool Upper_ge_lower(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Value_specification_constant(object, object)
If a non-literal ValueSpecification is used for the lower or upper bound, then that specification must be a constant expression. true
public bool Value_specification_constant(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Value_specification_no_side_effects(object, object)
If a non-literal ValueSpecification is used for the lower or upper bound, then evaluating that specification must not have side effects. true
public bool Value_specification_no_side_effects(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.