UnlimitedNatural

UnlimitedNatural

The standard type UnlimitedNatural is used to encode the non-negative values of a multiplicity specification. This includes a special unlimited value (*) that encodes the upper value of a multiplicity specification. UnlimitedNatural is itself an instance of the metatype UnlimitedNaturalType.

Note that UnlimitedNatural is not a subclass of Integer.

conformsTo OclComparable

Operations

max(i : OclSelf[?]) : UnlimitedNatural[1]

The maximum of self an i.

min(i : OclSelf[?]) : UnlimitedNatural[1]

The minimum of self an i.

oclAsType(TT)(type : TT[?]) : TT[?] invalidating

Evaluates to self, where self is of the type identified by T. The type T may be any classifier defined in the UML model; if the actual type of self at evaluation time does not conform to T, then the oclAsType operation evaluates to invalid.

The standard behavior is redefined for UnlimitedNatural. Numeric values may be converted to Real or Integer, but the unlimited value may not. Conversion of unlimited to Real or Integer returns invalid.

toInteger() : Integer[1] invalidating

Converts self to an Integer value unless self is unlimited in which case self is converted to invalid.