home
wiki
classes/clusters list
class information
+
Point of view
ANY
ANY
INTERNALS_HANDLER
All features
deferred class COMPARABLE
Summary
top
All classes handling
COMPARABLE
objects with a total order relation should inherit from this class.
Direct parents
insert list:
ANY
Known children
inherit list:
INTEGER_GENERAL
,
MUTABLE_BIG_INTEGER
,
NUMBER
,
REAL_GENERAL
,
REPOSITORY_TRANSIENT_OBJECT
,
STRING
,
UNICODE_STRING
insert list:
CHARACTER
,
MICROSECOND_TIME
,
TIME
Overview
top
exported features
is_equal
(other: COMPARABLE):
BOOLEAN
Is
other
attached to an object considered equal to current object?
infix "<"
(other: COMPARABLE):
BOOLEAN
Is
Current
strictly less than
other
?
infix "<="
(other: COMPARABLE):
BOOLEAN
Is
Current
less than or equal
other
?
infix ">"
(other: COMPARABLE):
BOOLEAN
Is
Current
strictly greater than
other
?
infix ">="
(other: COMPARABLE):
BOOLEAN
Is
Current
greater than or equal than
other
?
in_range
(lower: COMPARABLE, upper: COMPARABLE):
BOOLEAN
Return True if
Current
is in range [
lower
..
upper
]
See also
min
,
max
,
compare
.
compare
(other: COMPARABLE):
INTEGER_32
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
three_way_comparison
(other: COMPARABLE):
INTEGER_32
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
min
(other: COMPARABLE): COMPARABLE
Minimum of
Current
and
other
.
max
(other: COMPARABLE): COMPARABLE
Maximum of
Current
and
other
.
is_equal
(other: COMPARABLE):
BOOLEAN
effective function
top
Is
other
attached to an object considered equal to current object?
require
other /= Void
ensure
trichotomy:
Result = not Current
<
other and not other
<
Current
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
infix "<"
(other: COMPARABLE):
BOOLEAN
deferred function
top
Is
Current
strictly less than
other
?
See also
>
,
<=
,
>=
,
min
,
max
.
require
other_exists:
other /= Void
ensure
asymmetric:
Result implies not other
<
Current
infix "<="
(other: COMPARABLE):
BOOLEAN
effective function
top
Is
Current
less than or equal
other
?
See also
>=
,
<
,
>
,
min
,
max
.
require
other_exists:
other /= Void
ensure
definition:
Result = Current
<
other or
is_equal
(other)
infix ">"
(other: COMPARABLE):
BOOLEAN
effective function
top
Is
Current
strictly greater than
other
?
See also
<
,
>=
,
<=
,
min
,
max
.
require
other_exists:
other /= Void
ensure
definition:
Result = other
<
Current
infix ">="
(other: COMPARABLE):
BOOLEAN
effective function
top
Is
Current
greater than or equal than
other
?
See also
<=
,
>
,
<
,
min
,
max
.
require
other_exists:
other /= Void
ensure
definition:
Result = other
<=
Current
in_range
(lower: COMPARABLE, upper: COMPARABLE):
BOOLEAN
effective function
top
Return True if
Current
is in range [
lower
..
upper
]
See also
min
,
max
,
compare
.
ensure
Result = Current
>=
lower and Current
<=
upper
compare
(other: COMPARABLE):
INTEGER_32
effective function
top
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
See also
min
,
max
,
in_range
.
require
other_exists:
other /= Void
ensure
equal_zero:
Result = 0 =
is_equal
(other)
smaller_negative:
Result = -1 = Current
<
other
greater_positive:
Result = 1 = Current
>
other
three_way_comparison
(other: COMPARABLE):
INTEGER_32
effective function
top
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
See also
min
,
max
,
in_range
.
require
other_exists:
other /= Void
ensure
equal_zero:
Result = 0 =
is_equal
(other)
smaller_negative:
Result = -1 = Current
<
other
greater_positive:
Result = 1 = Current
>
other
min
(other: COMPARABLE): COMPARABLE
effective function
top
Minimum of
Current
and
other
.
See also
max
,
in_range
.
require
other /= Void
ensure
Result
<=
Current and then Result
<=
other
compare
(Result) = 0 or else other.
compare
(Result) = 0
max
(other: COMPARABLE): COMPARABLE
effective function
top
Maximum of
Current
and
other
.
See also
min
,
in_range
.
require
other /= Void
ensure
Result
>=
Current and then Result
>=
other
compare
(Result) = 0 or else other.
compare
(Result) = 0