Abstraction of ordinal types, that is, of types where
each instance has a successor
and predecessor
, such
as:
Integer
and other
Integral
numeric types, and even Character
, along
withThe increment operator ++
and decrement operator --
are defined for all types which satisfy Ordinal
.
function increment() { count++; }
Many ordinal types have a total order. If an ordinal type has a total order, then it should satisfy:
x.successor >= x
, andx.predecessor <= x
.An ordinal enumerated type X
with a total order has
well-defined maximum
and minimum
values where
minimum<x<maximum
for any other instance x
of X
.
Then the successor
and predecessor
operations should
satisfy:
minimum.predecessor==minimum
, andmaximum.successor==maximum
.Character
, Integer
, Integral
, Comparable
, Enumerable
no type hierarchy
no supertypes hierarchy
Attributes | |
predecessor | Source Codeshared formal Other predecessor The predecessor of this value. |
successor | Source Codeshared formal Other successor The successor of this value. |
Inherited Attributes |
Attributes inherited from: Object |