|
|
|
|
Re: LiteralUnlimitedNatural.UNLIMITED [message #735765 is a reply to message #735652] |
Wed, 12 October 2011 12:41  |
Eclipse User |
|
|
|
Hi
Oops. Yes. Not an Enumeration; sure I checked, but no.
The implementation of numbers is implementation-specific; MDT/UML2 opts
for Java's Integer.
The UML specification is genuinely unlimited and the equivalent Integer
implementation for MDT/OCL has attracted bug reports, so that the
traditional code now has some support for a Long range. The new Pivot
model implementation is IntegerValue which has polymorphic
Integer/Long/BigInteger realisations.
* or UNLIMITED is really a misnomer for plus infinity. It is bigger than
MAXINT. -1 is clearly not bigger than MAXINT, so all code that accesses
an UnlimitedNatural must special case the out of bounds negative value.
Regards
Ed Willink
On 12/10/2011 14:31, Kenn Hussey wrote:
> Uh, it's not an enumeration literal and the value is -1, not 1.
> Because an unlimited natural is supposed to be a natural number (i.e.,
> 0 or higher), the value of -1 is used as a special indicator to mean
> the maximum possible value. The same is done for upper bounds on Ecore
> features in EMF.
>
> Kenn
|
|
|
Powered by
FUDForum. Page generated in 0.04026 seconds