<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.4.4. Multiplicity Constant</title><link href="style.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.72.0" name="generator"><link rel="start" href="index.html" title="The VIATRA2 Model Transformation Framework"><link rel="up" href="sec_ASMConstants.html" title="5.4. Constants"><link rel="prev" href="def_BooleanConstant.html" title="5.4.3. Boolean Constant"><link rel="next" href="def_StringConstant.html" title="5.4.5. String Constant"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">5.4.4. Multiplicity Constant</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="def_BooleanConstant.html">Prev</a> </td><th align="center" width="60%">5.4. Constants</th><td align="right" width="20%"> <a accesskey="n" href="def_StringConstant.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="def_MultiplicityConstant"></a>5.4.4. Multiplicity Constant</h4></div></div></div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Description"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left"><a name="def_MultiplicityConstant_Description"></a>Description</th></tr><tr><td valign="top" align="left"><p> | |
A <span class="strong"><strong>multiplicity constant</strong></span> | |
<a name="N128F1" class="indexterm"></a> | |
<a name="N128F6" class="indexterm"></a> | |
is used to specify multiplicity | |
restrictions for a <a href="def_Relation.html" title="2.2.2. Relation">relation</a>. | |
</p></td></tr></table></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Syntax"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Important]" src="images/important.png"></td><th align="left"><a name="def_MultiplicityConstant_Syntax"></a>Syntax</th></tr><tr><td valign="top" align="left"><pre class="programlisting"> | |
MultiplicityConstantAST ::= <span class="token">one_to_one</span> | <span class="token">one_to_many</span> | |
| <span class="token">many_to_one</span> | <span class="token">many_to_many</span> | |
</pre><p> | |
The possible values of a <span class="strong"><strong>multiplicity constant</strong></span> are | |
<code class="computeroutput">one_to_one</code>, <code class="computeroutput">one_to_many</code>, <code class="computeroutput">many_to_one</code> | |
and <code class="computeroutput">many_to_many</code>. | |
</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note: Semantics"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left"><a name="def_MultiplicityConstant_Semantics"></a>Semantics</th></tr><tr><td valign="top" align="left"><p> | |
Both end of a relation can have either the multiplicity <span class="emphasis"><em>one</em></span>or the | |
multiplicity <span class="emphasis"><em>many</em></span>. In the model space only a single property determines | |
the multiplicity of a relation that holds the multiplicity information for | |
both ends. | |
</p><p> | |
The interpretation of multiplicity kinds in VPM are | |
</p><div class="itemizedlist"><ul type="disc"><li><p><span class="strong"><strong>one_to_one</strong></span>: for each source element at most one target | |
element can be in relation, and for each target element at most one source | |
element can be in relation for each instance of the relation, | |
</p></li><li><p><span class="strong"><strong>one_to_many</strong></span>: for each target element at most one source | |
element can be in relation each instance of the relation, | |
</p></li><li><p><span class="strong"><strong>many_to_one</strong></span>: for each source element at most one target | |
element can be in relation for each instance of the relation | |
</p></li><li><p><span class="strong"><strong>many_to_many</strong></span>: an arbitrary number of source and target | |
elements can be in relation. | |
</p></li></ul></div><p> | |
The default value of a multiplicity is <code class="computeroutput">many_to_many</code>. | |
</p></td></tr></table></div><div class="highlights"><a name="def_MultiplicityConstant_DefinedIn"></a><p><b>Defined In: </b> | |
<a href="def_AsmConstant.html" title="5.4.1. ASM Constant (Value)">ASM constant</a> | |
</p></div><div class="highlights"><a name="def_MultiplicityConstant_UsedBy"></a><p><b>Used By: </b> | |
<a href="def_ElementUpdateRule.html" title="4.4.6. Element Update Rule">element update rule</a> (<code class="computeroutput">setMultiplicity</code>), | |
<a href="def_PredefinedFunctionCall.html" title="5.6.1. Predefined Function Call">predefined function call</a> ( <code class="computeroutput">multiplicity</code>) | |
</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="def_BooleanConstant.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="sec_ASMConstants.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="def_StringConstant.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">5.4.3. Boolean Constant </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%"> 5.4.5. String Constant</td></tr></table></div></body></html> |