11.5.5 UnlimitedNatural
+ (u : UnlimitedNatural) : UnlimitedNatural
self和 u 相加的值。如果self或u 任一为unlimited,则结果为invalid。
* (u : UnlimitedNatural) : UnlimitedNatural
self 和u的乘积值。如果self或u 任一为unlimited,则结果为invalid。
/ (u : UnlimitedNatural) : Real
self除以u的值。如果u等于零或self或u 任一为unlimited,结果为invalid。
div(u : UnlimitedNatural) : UnlimitedNatural
self整除u的值。如果u等于零或self或u 任一为unlimited,结果为invalid。
post: result = (self / u).floor()
mod( u : UnlimitedNatural) : UnlimitedNatural
self除以u的余数。如果u等于零或self或u 任一为unlimited,结果为invalid。
post: result = self - (self.div(u) * u)
max(u : UnlimitedNatural) : UnlimitedNatural
self和u的最大者。
post: if self = * or u = * then result = *
else if self >= u then result = self else result = u endif endif
min(u : UnlimitedNatural) : UnlimitedNatural
self和u的最小者。
post: if self = * then
result = u
else if u = * then
result = self
else if self <= u then
result = self
else result = u
endif endif endif
< (u : UnlimitedNatural) : Boolean
如果self小于u,则为真。
post: if self = * then result = false
else if u = * then result = true
else result = self.toInteger() < u.toInteger() endif endif
> (u : UnlimitedNatural) : Boolean
如果self大于u,则为真。
post: if u = * then result = false
else if self = * then result = true
else result = self.toInteger() > u.toInteger() endif endif
<= (u : UnlimitedNatural) : Boolean
如果self小于等于u,则为真。
post: if u = * then result = true
else if self = * then result = false
else result = self.toInteger() <= u.toInteger() endif endif
>=(u : UnlimitedNatural) : Boolean
如果self大于等于u,则为真。
post: if self = * then result = true
else if u = * then result = false
else result = self.toInteger() >= u.toInteger() endif endif
toInteger() : Integer
将self转化为一个整数值。如果self是unlimited,则结果为invalid。
post: if self = * then result = invalid
else result = self.oclAsType(Integer) endif
toString() : String
使用由http://www.w3.org/TR/xmlschema-2/ #nonNegativeInteger定义的标准格式将self转换为一个字符串值。如果self是unlimited,则结果是‘*’。