<html> | |
<head> | |
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | |
<title>UnlimitedNatural</title> | |
<link href="book.css" rel="stylesheet" type="text/css"> | |
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator"> | |
<link rel="home" href="index.html" title="OCL Documentation"> | |
<link rel="up" href="StandardLibrary.html" title="The OCL Standard Library"> | |
<link rel="prev" href="UniqueCollection.html" title="UniqueCollection(T)"> | |
<link rel="next" href="Tutorials.html" title="Tutorials"> | |
</head> | |
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | |
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> | |
UnlimitedNatural | |
</h1> | |
<div class="section" title="UnlimitedNatural"> | |
<div class="titlepage"> | |
<div> | |
<div> | |
<h2 class="title" style="clear: both"> | |
<a name="UnlimitedNatural"></a> | |
<span class="bold"><strong> | |
<code class="code">UnlimitedNatural</code> | |
</strong></span> | |
</h2> | |
</div> | |
</div> | |
</div> | |
<p>The standard type UnlimitedNatural is used to encode the non-negative values of a multiplicity specification. | |
This includes a special | |
<span class="emphasis"><em>unlimited</em></span> value (*) that encodes the upper value of a multiplicity specification. | |
UnlimitedNatural is itself an instance of the metatype UnlimitedNaturalType. | |
</p> | |
<p>Note that UnlimitedNatural is not a subclass of Integer.</p> | |
<p>conformsTo | |
<a class="link" href="OclComparable.html" title="OclComparable"> | |
<code class="code">OclComparable</code> | |
</a> | |
</p> | |
<p> | |
<span class="bold"><strong>Operations</strong></span> | |
</p> | |
<p> | |
<code class="code">max(i : OclSelf[?]) : UnlimitedNatural[1]</code> | |
</p> | |
<p>The maximum of | |
<code class="code">self</code> an i. | |
</p> | |
<p> | |
<code class="code">min(i : OclSelf[?]) : UnlimitedNatural[1]</code> | |
</p> | |
<p>The minimum of | |
<code class="code">self</code> an i. | |
</p> | |
<p> | |
<code class="code">oclAsType(TT)(type : TT[?]) : TT[?] invalidating</code> | |
</p> | |
<p>Evaluates to | |
<code class="code">self</code>, where | |
<code class="code">self</code> is of the type identified by T. | |
The type T may be any classifier defined in the UML model; | |
if the actual type of | |
<code class="code">self</code> at evaluation time does not conform to T, | |
then the oclAsType operation evaluates to | |
<code class="code">invalid</code>. | |
</p> | |
<p>The standard behavior is redefined for UnlimitedNatural. Numeric values may be converted to | |
Real or Integer, but the | |
<span class="emphasis"><em>unlimited</em></span> value may not. | |
Conversion of | |
<span class="emphasis"><em>unlimited</em></span> to Real or Integer returns | |
<code class="code">invalid</code>. | |
</p> | |
<p> | |
<code class="code">toInteger() : Integer[1] invalidating</code> | |
</p> | |
<p>Converts | |
<code class="code">self</code> to an Integer value unless | |
<code class="code">self</code> is | |
<code class="code">unlimited</code> in which | |
<code class="code">self</code> is converted to | |
<code class="code">invalid</code>. | |
</p> | |
</div> | |
</body> | |
</html> |